home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir42
/
dbol110b.zip
/
DBONLINE.DOC
< prev
next >
Wrap
Text File
|
1993-11-22
|
174KB
|
6,865 lines
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄ ▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄▄▄▄▄▄▀▀▀▄▄▄▄▄▄▀▀░░
██████████████▀ █▀ ██░░
▄▄▄▄▄▄▄▄▄▄▄▄▄ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄▄░░
▀▀▀▀▀▀▀▀▀▀▀▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀▀░░
██████████▀ ▄ ▄█ ██░░
▄▄▄▄▄▄▄▄▄ ▀▀▀▀▀█▄▀▀▀▀▀▀█▄▄▀▀▀▀▀▄▄░░
▀▀▀▀▀▀▀▀▄▄▄▄▄▄▀▀▀▄▄▄▄▄▀▀▀▀▄▄▄▄▄▀▀░░
██████▀ ▄████ ▄█████ ██░░
▄▄▄▄▄ ▀▀▀▀▀█▄▄▄▄▄▀██▄▄▄▄▄▄▀▀▀▀▀▄▄░░
▀▀▀▀▄▄▄▄▄▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄▄▄▄▄▀▀░░
██▀ ▄█████████████████ ██░░
▄▄██████▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█████▄▄░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
dB Online version 1.1
──────────────────────
Administrator's Manual
Merlin Systems Inc.
Ottawa, Ontario, Canada
Copyright (c) 1993 Merlin Systems Inc. All rights reserved. This software
product and this manual are copyrighted and all rights are reserved by Merlin
Systems Inc. No part of the contents of this manual may be reproduced or
transmitted in any form or by any means without the written permission of the
publisher.
Merlin Systems Inc. does not assume any liability arising out of the
application or use of any products described herein. Merlin Systems Inc.
further reserves the right to make changes in any products described herein
without notice. This document is subject to change without notice.
dBASE III+ is a registered trademark of Borland International Inc.
dBASE IV is a registered trademark of Borland International Inc.
Clipper is a registered trademark of Computer Associates Inc.
FoxPro and MS-DOS are registered trademarks of Microsoft Corporation.
DigiBoard is a registered trademark of DigiBoard Corp.
PCBoard in a trademark of Clark Development Company, Inc.
All other trademarks and registered trademarks are the properties of their
respective owners.
Document: dbonline.doc
Revision Date: 11/22/93 rev. 1
Merlin Systems Inc.
P.O. Box 3043, Station C
Ottawa, Ontario
K1Y 4J3 Canada
Phone: 613-236-1138
BBS & Fax: 613-236-1481
Internet: support@merlin-systems.on.ca
FidoNet: support 1:163/509
UUCP: uunet!mersys!support
MHS: support @ merlin [cserve]
Compuserve: >MHS: support @ merlin
>INTERNET: support@merlin-systems.on.ca
C O N T E N T S
Introduction ........................................ 1
Installation ........................................ 2
Diskette Installation ............................. 2
Zip File Installation ............................. 2
Installed Files ................................... 3
Database Concepts ................................... 4
What is a database? ............................... 4
Fields ............................................ 4
Records ........................................... 4
................................
Tags .............. 4
Indexes ........................................... 5
Compiling ........................................... 6
Source Code Format (.PRG) ......................... 6
Compile Syntax .................................... 6
Examples .......................................... 8
Execution ........................................... 9
File Format Compatibility ......................... 9
Operation Modes ................................... 9
Communications ..................................... 12
PORT Command Syntax .............................. 12
Language Reference ................................. 14
Symbols and Conventions .......................... 14
Expressions ...................................... 15
Database Commands ................................ 17
Database Functions ............................... 57
BBS Information Functions ........................ 89
Appendices ......................................... 98
Appendix 1: Errorlevels ......................... 98
Appendix 2: Compiler Messages .................. 101
Appendix 3: Runtime Errors ..................... 103
Appendix 4: Full Screen Entry Keys .............. 105
Introduction
dB Online is the first database application specifically designed for online
environments. It provides a complete programming language that enables you to
access, display, edit, and append to database files.
dB Online accesses industry standard .DBF files with a superset of the dBASE
III+ programming language. This allows you to use existing database
applications, or easily create new ones. There is no need to learn new
scripting languages.
dB Online operates in three communications modes:
In BBS Doorway Mode , dB Online operates with most popular BBS's as a seamless
door. BBS and user information is passed to dB Online and is available to the
developer through xBase type function calls.
In Local/LAN Mode , dB Online provides a method for your local users to access
the dB Online application. This mode is also useful for testing and debugging
your application.
In Stand Alone Mode , dB Online operates without a BBS. It will wait for
callers and make a connection before executing the application. This provides
an alternative method to supply database access in an online environment.
dB Online is multi-user compatible and provides full file and record locking
capabilities. dB Online employs locking methods compatible to your native
database management system. dB Online can be run concurrently with your
existing applications and access the same data files simultaneously.
While dB Online's strength is it's ability to access database files, it also
provides a complete language to create any type of door for your BBS.
dB Online Licence Levels
There are three current license levels of dB Online. They are Shareware,
Registered, and Pro. The difference in features is outlined below.
1 The Shareware version of dB Online is available free of charge. It
allows full access to the dB Online language with the following
exceptions: Any database files greater than 50 records are not
supported. Only one database may be open at a time. The RUN (shell to
DOS) command is not supported.
2 The Registered version of dB Online removes the 50 record limit and
allows the RUN command. Only a single database may be open at a time.
3 The Pro version allows up to 20 databases to be open at once. These
database may be related providing a fully relational database
management system. In addition dB Online Procan operate in a Stand
Alone mode. This allows dB Online to operate without a BBS providing
an inexepensive method of providing database access online.
The license level is determined by the DBONLINE.KEY file.Installation
There are two methods of installing dB Online. There is installation from
diskette (Pro Version only) or installation from a zip file.
1
Installation
Diskette Installation
The dB Online diskette includes an installation program. The steps to follow
are:
1. Insert the diskette into the drive you want to install from:
2. Run the install program on the diskette by typing:
a:install
3. The install program will ask you for the directory to install dB Online.
It will also ask you the file format compatibility you wish to install.
You have a choice of one or more of the following: dBASE III+, dBASE IV,
Clipper or FoxPro.
4. Install will copy all necessary files into the specified directory.
5. Please review the readme.txt file for any product revisions.
6. Once installation is complete proceed to the COMPILING and EXECUTION
sections to create your first online database application.
Zip File Installation
If you received dB Online from a download you should install as follows:
1. Create a directory for dB Online:
md c:\dbonline
2. Unzip the dbol???.zip file into this directory: (??? refers to the
version number of dB Online)
pkunzip dbol???.zip c:\dbonline
3. Copy the dbonline.key file into the dB Online directory. (Registered
version only)
4. Please review the readme.txt file for any product revisions.
5. Once installation is complete proceed to the COMPILING and EXECUTION
sections to create your first online database application.
2
Installed Files
The following files should be in your dB Online directory after installation:
COMPILE.EXE Source .PRG compiler
DBOLFOX.EXE dB Online executable for FoxPro compatibility
DBOL4.EXE dB Online executable for dBASE IV compatibility
DBOL3.EXE dB Online executable for dBASE III+ compatibility
DBOLCLIP.EXE dB Online executable for Clipper compatibility.
DBONLINE.DOC ASCII version of this document
README.TXT Product revisions and documentation updates.
REGISTER.DOC Product registration information.
DBONLINE.KEY Key file to access Registered functions.
3
Database Concepts
What is a database?
A database is a organized collection of related information or data. A
common example of a database is a telephone book. It contains name,
phone numbers, and addresses of thousands of people. Each entry in the
phone book corresponds to a record , and each piece of information in the
record, such as the name or phone number, corresponds to a field . A
group of records such as a telephone book becomes a database.
dB Online accesses the industry standard .DBF database files. This
standard, known as the xBase standard, is presently the most widely used
database standard.
Fields
A field is the most basic piece of data in a database file. There are
four attributes that describe each field. These are described below:
1 NAME: This refers to the name that will be used to identify the field.
A field name can have a maximum of 10 characters. It must begin with
an alphabetical character and may consist of any combination of
alphanumeric or underscore characters.
2 TYPE: The type of the field determines what kind of information is
stored. There are 5 types of fields in the xBase standard: Character,
Date, Logical, Numeric, and Memo. The first four are fixed length
fields and the Memo field is variable length.
3 LENGTH: This refers to the number of characters or digits that can be
stored in the field.
4 DECIMALS: This only applies to Numeric fields. It specified the
number of digits to follow the decimal place.
Memo fields are stored in a separate file and entries are referenced from
a fixed field in the database file. A memo entry can be 64000 characters
in length.
Records
A record consists of one instance of every field. Each record has a
unique record number. The record number indicates the physical position
of the data in the data file. Each record also has a deletion flag.
This deletion flag determines weather a record is to be removed when the
file is packed.
Tags
A tag determines the order that the records in the database file are
presented. The tag does not affect the physical ordering of the database
4
but only the order in which they are accessed. Tags are created by
specifying an expression that the records are ordered from. The results
of this expression is stored in the index key.
Indexes
An index is a file containing the sorted index keys for one or more tags.
dB Online supports several formats of index files. They are specified
below by the index file extensions:
.CDX FoxPro
.MDX dBASE IV
.NDX dBASE III+
.NTX Clipper
The .CDX and .MDX formats allow you to have multiple tags in each index
file, and production index files. Production index files open
automatically when the associated database is opened. The .NDX and .NTX
index formats allow only one tag per index file.
5
Compiling
Source Code Format (.PRG)
The source code for a dB Online program consists of one or more .PRG
files. These are the standard source files for all xBase applications.
The dB Online source program is defined by a main .PRG file and optional
procedure files.
The main file is the file that will be executed first once the source is
compiled. Procedure files are specified using the SET PROCEDURE TO
command. These files must include only procedure definitions. The main
file and all its procedure files are compiled into a single source .DBX
file.
The following code provides an example of the Source Code Format:
FILE: main.prg
* Beginning of main.prg
SET PROCEDURE TO function.prg && Includes procedure file function.prg
...
RETURN && ends main program
PROCEDURE proc1 && procedure definition with main program
...
RETURN
FILE: function.prg
* Beginning of function.prg
PROCEDURE proc2 && Procedure files only contain procedures
...
RETURN
PROCEDURE proc3
...
PROCEDURE proc4 && RETURN assumed before PROCEDURE
...
RETURN
Compile Syntax
The command line syntax of the dB Online compiler is:
COMPILE <source.prg>
<source.prg> identifies the main file to be compiled.
The dB Online compiler will compile the source code of the main file.
Any procedure files identified in the main file with the SET PROCEDURE TO
command will also be compiled. The dB Online compiler will do full
syntax checking for all dB Online commands.
6
Compile will output two types of messages during the compile.
1 Error messages indicate errors in the source code program. Compile
will indicate the source line number and show where the error occurred
in the actual source code.
2 Warning messages indicate code that is not applicable to an executable
version of an xBase program. These include commands such as SET TALK,
SET SCOREBOARD, etc.
If there are zero error messages as a result of the compile, dB Online
will then link all procedure calls in the code. Procedure definition are
compared with procedure calls to ensure that the correct number of
parameters are being passed and that all procedure calls have
corresponding procedure definitions.
If there are no linking errors then a compiled source .DBX file is
created. This is the file to be used with the dbonline.exe executable.
All compilation error and warning messages are listed in APPENDIX 2.
7
Examples
Consider the following program: sample.prg
** File: sample.prg
? "Hello"
Return
The output from the compiler would be:
dB Online 1.10 Compile Copyright (c) 1993 Merlin Systems Inc.
------------------------------------------------------------------------------
COMPILING: sample.prg
TOTAL ERRORS: 0 TOTAL WARNINGS: 0
LINKING PROCEDURE CALLS
SUCCESS
WRITING FILE: sample.dbx
For the following program: sample2.prg
** File: sample2.prg
USE customer.dbf ALIAX clients
LIST
RETURN
The output from the compiler would be:
dB Online 1.10 Compile Copyright (c) 1993 Merlin Systems Inc.
------------------------------------------------------------------------------
COMPILING: sample2.prg
*** ERROR: Syntax Error. Line: 2
USE customer.dbf ALIAX clients
^
TOTAL ERRORS: 1 TOTAL WARNINGS: 0
8
Execution
dB Online operates with a number of database file formats, and three operating
modes. These options are explained in this section.
File Format Compatibility
dB Online presently supports 4 common file formats. There is a separate
dbonline.exe file for each format. This information is outlined in the
following table:
File Index Memo dB Online
Format Format Format Executable
dBASE III+.NDX .DBT DBOL3.EXE
CLIPPER .NTX .DBT DBOLCLIP.EXE
dBASE IV .MDX .DBT DBOL4.EXE
FoxPro .CDX .FPT DBOLFOX.EXE
When referring to the dB Online executable, this manual will use dbonline.exe.
However one of the above executables must be replaced for dbonline.exe on the
command line.
Operation Modes
There are three modes of operation for dB Online: BBS Doorway Mode, Local /
LAN Mode and Stand Alone Mode. The dB Online calling conventions for each
mode area outlined below.
BBS Doorway Mode
To operate in BBS Doorway Mode you will need to use your BBS software to setup
dB Online as a door. The BBS software will require you to create a batch file
for the doorway. Please refer to your BBS documentation for assistance.
dB Online's command line syntax for BBS Doorway Mode operation is as follows:
dbonline <source.dbx> <bbs drop files> [PORT:xxxx:n,y]
<source.dbx> is the path and filename of the compiled .PRG files
<bbs drop files> can consist of any combination of the following.
DOOR.SYS
PCBOARD.SYS
DORINFOx.DEF
CALLINFO.BBS
CHAIN.TXT
USERS.SYS
EXITINFO.BBS
9
The BBS drop files are created by the BBS whenever a door is executed.
Consult your BBS documentation for the BBS drop files created. At least
one of the files in italics is required as they provide COMM port
information for dB Online. USERS.SYS and EXITINFO.BBS only provide user
information.
If the information in the <bbs drop files> provide a zero for the COMM
port or BAUD settings then operation will default to Local/Lan Mode
operation. This allows local nodes to log into your BBS and access the
dB Online door application.
[PORT :xxxx:n,y] is for custom port configuration This is not usually
required for standard BBS Doorway Mode operation. For more information,
see the Communications section.
Local/LAN Mode
dB Online can be executed in Local or LAN Mode. This allows for local testing
and debugging of the application, as well as servicing all LAN nodes on your
BBS.
dB Online's command line syntax for Local/Lan Mode operation is as follows:
dbonline <source.dbx>
<source.dbx> is the path and filename of the compiled .PRG file. dB
Online assumes a .DBX file extension if none is given.
Local/Lan Mode operation will not output to any communications port. It
only displays on the local screen.
Stand Alone Mode
dB Online provides a method to operate over a COMM port without the need of a
BBS. Stand Alone mode will wait to receive a call on the modem and then
connect with the user before executing the .DBX file.
dB Online's command line syntax for Stand Alone Mode operation is as follows:
dbonline <source.dbx> -SA PORT:xxxx:n,y
<source.dbx> is the path and filename of the compiled .PRG file.
The -SA option identifies Stand Alone Mode operation.
The PORT : command is not optional in Stand Alone operation. It must be
specified in order that dB Online call detect incoming calls. Please see
the Communications section for more details.
10
Upon execution dB Online Stand Alone will enter the call waiting screen.
This screen is shown below:
UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA?
3 UU UUUUUUU UUUUUUUU UU 3
3 UU UUBBBBUU UUBBBBBBUU UU 3
3 UU UU UU UU UU UU UU 3
3 UU UU UU UU UU UU 3
3 UUUUUUUUU UUUUUUU UU UU UUUUUUUU UU UU UUUUUUUU UUUUUUUUU 3
3 UU UU UU UU UU UU UUB UU UU UU UUB UU UU UU 3
3 UU UU UU UU UU UU UU UU UU UU UU UU UUUUUUUUU 3
3 UU UU UU UU UU UU UU UU UU UU UU UU UU 3
3 BUUUUUBUU UUUUUUUB BUUUUUUUUB UU UU UU UU UU UU BUUUUUUUB 3
3 3
3 dB Online v1.10 Copyright (c) 1993 Merlin Systems Inc. 3
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU
U Port Status AAAAAAAAAAAAAAA? U Connection Status AAAAAAAAAAAAAAAAAAAAAAAA?
3 Driver: COMx (UART) 3 3 t Resetting modem 3
3 Port: 2 3 3 t Waiting for call 3
3 Baud: 9600 3 3 3
3 Last Call: 10/21/93 09:24 3 3 3
3 # of Calls: 15 3 3 3
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAU AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU
UAAAAAAAAAAAAA? UAAAAAAAAAAAAAAAAAAA?
3 <Esc> Exit 3 3 <F2> Local Login 3
AAAAAAAAAAAAAAU AAAAAAAAAAAAAAAAAAAAU
This entry screen provides information on the PORT settings as well as
previous caller information. There is a window that indicates the
Connection Status of the PORT.
There are three events that will exit from the call waiting screen.
1 A call is received. dB Online will make a connection and then execute
the specified .DBX program.
2 The local user presses <F2>. dB Online will then execute the specified
.DBX program in local mode.
3 The local user presses <Esc>. dB Online will exit and return a DOS
errorlevel of 114 (defined in Appendix 1).
Once dB Online terminates for any reason, it will return control to DOS.
You must create a batch file that will re-enter dB Online to wait for
another caller.
Example:
This example batch file will start dB Online Stand Alone with a source
file sample.dbx using COMM port 1 at 9600 baud. If the user presses
<Esc> at the call waiting screen then the batch file will terminate.
:start
dbonline sample.dbx -SA PORT:COM:1,9600
REM if local user presses escape (error level 114) do not re-enter dB Online.
if errorlevel 115 goto start
if errorlevel 114 goto end
goto start
:end
11
Communications
dB Online includes the ability to communicate with a wide variety of
communications hardware. Support is provided for standard COM ports, FOSSIL
drivers, Interrupt 14 (BIOS), DigiBoard, Arnet, and Stargate smart I/O cards.
16550 FIFO support is automatically handled.
The PORT command line parameter is used to specify custom port configurations
for use with dB Online. A PORT command is required for Stand Alone operation
and may be required for BBS Doorway Mode operation.
PORT Command Syntax
The PORT command line parameter has the following syntax:
PORT:<driver>:<port>,<baud>
The <driver> settings are outlined below:
COM
The COM <driver> setting is for standard COM ports.
For ISA machines the <port> value is between 1 and 4. For Multichannel
machines the <port> value can be from 1 to 8.
The <baud> value can range up to 115200.
INT14
This INT14 <driver> setting is for Interrupt 14 (BIOS) ports.
With this driver, dB Online will access the serial port through Interrupt
14. INT14 should be used if you have a TSR or driver that uses Int 14 to
route serial calls to something other than the COM ports. INT14 should
also be used if you have a non-intelligent I/O board and are using its
driver software.
The <port> value is the same as the standard COM port values.
The <baud> value can range up to 19200.
FOSSIL
The FOSSIL <driver> setting is for FOSSIL drivers.
Use this driver if you have a FOSSIL driver installed. Two such drivers
are X00 and BNU.
The <port> and <baud> values are dependent on the FOSSIL driver.
12
SDIGI
The SDIGI <driver> setting is for an Intelligent DigiBoard I/O board.
A recent version of the DigiBoard driver will be required. The most
recent driver as of printing of this manual was XDIDOS5.SYS version
4.0.5. It is available from the DigiBoard BBS at 612-943-0812.
The <port> value will be the DigiBoard channel to be use. The <baud>
value can range up to 115,200.
For proper DigiBoard operation ensure the driver is configured for EBIOS
support, and that the IRQ line, the character ready flag, and the
handshaking are all disabled.
SARNET
The SARNET <driver> setting is for an Intelligent Arnet I/O board.
The <port> value is the channel or handle as stated by the Arnet device
driver upon loading.
The <baud> value can range up to 115200.
SSTAR
The SSTAR <driver> setting is for an Intelligent StarGate I/O board.
Your StarGate smart I/O card should have an I/O address of 0x200 at
D000:0000 starting at COM5.
The <port> value is the handle or channel to use and can range from 0
through to 32767.
The <baud> value can range up to 38400.
13
Language Reference
Symbols and Conventions
The following symbols are used throughout the Language Reference section to
describe the syntax of the dB Online commands and functions.
Symbol Definition
<item> Angle brackets indicate that you must
enter the enclosed item. Do not enter
the angled brackets.
[item] Square brackets indicate that the
enclosed item is optional. Do not
enter the Square brackets.
<item1>|<item2> The vertical line separates choices of
items. Choose one of the options
given.
<expr> A valid dB Online expression must be
entered. See the Expressions section
below.
<nexpr> A numeric expression must be entered
here.
<cexpr> A character expression must be entered
here.
<dexpr> A date expression must be entered here.
<lexpr> A logical expression must be entered
here.
<var> A memory variable identifier must be
entered here.
<field> A database field identifier must be
entered here.
<alais> A character alias identifier must be
entered here.
<proc name> A procedure name must be entered here.
<filename> A valid DOS filename must be entered
here. This can include the drive and
full path if necessary.
<text> Any text may be entered here.
<scope> Allows the specification of records.
Valid values are: ALL, RECORD <nexpr>,
NEXT <nexpr>, REST.
<commands> Any dB Online command may be entered
here.
<item list> The word list following an item
indicates that a number of items may be
entered. These items must be separated
by a comma (,).
14
<item> An item in italics indicate that it may
be macro substituted. See the Macro
(&) function for more details.
The naming conventions for <var>, <field>, <proc name>, and <alias> area all
the same. They may be up to 10 characters in length, can consist of
alphanumeric and underscore characters, and must begin with an alphabetic
character.
Expressions
dB Online provides a complete expression evaluator. The components of these
expression are outlined below:
Variables/Fields
Variables can contain 4 types of data: character, numeric, date and
logical. Fields have the same data types and also include the memo field
type.
Aliases
There are twenty work areas available in dB Online. Aliases identify the
work area of a specific database. The alias of a work area is usually
the database file name minus the extension. This can be changed using
the USE...ALIAS command. The alias for the first 10 areas can also be
referred to as A through J.
To specify a field from another work area the aliasing indicator (-> or
.) must be used. For example to specify the NAME field in the second
work area you would type:
B->NAME or B.NAME
To avoid confusion between a memory variable and a field of the same name
you may explicitly specify the variable by writing M->VARIABLE.
Mathematical Operators
dB Online supports the standard symbols for mathematical calculations:
Operator Description
+ Addition
- Subtraction
* Multiplication
/ Division
^ Exponent
** Exponent
These operators may all be used with numeric operands.
The +,- operators may be used with character operands. The + operator
will concatenate two character strings. The - operator will also
15
concatenate two strings but will move any trailing blanks from the first
string to the end of the concatenated string.
The +,- operators may be used for date arithmetic. Both can be used to
add or subtract a specific number of days from a date value. For example
{10/21/93} + 7 will return 10/28/93. Two dates may be subtracted from
each other to determine the number of days in between them.
Relational Operators
dB Online supports the following relational operators:
Operator Description
< Less than
> Greater than
= Equal to
<> Not equal to
# Not equal to
<= Less than or equal
to
>= Greater than or
equal to
$ Is contained in
The results of all relational operators is a logical value.
The $ operator is valid with character operands. If A and B area
character strings, A$B returns True (.T.) if A is either identical to B
or contained within B.
Logical Operators
dB Online supports the following logical operators:
Operator Description
.AND. Logical AND
.OR. Logical OR
.NOT. Logical NOT (unary
operator)
16
Operator Precedence
dB Online evaluates expressions with the following standard operator
precedence:
OperatorsDescription
( ) Parenthesis
grouping
+ - Unary positive and
negative
** ^ Exponent
* / Multiplication,
Division
+ - Addition,
Subtraction
< > Relational
<= >= Operators
= !=
# $
.NOT. Logical Not
.AND. Logical And
.OR. Logical Or
All operations at the same precedence level are performed in order from
left to right.
17
Database Commands
The following section outlines the available commands in dB Online. All
coding examples in the next sections follow this format:
<command> && comments Data Output
The characters in the right most column are the output from the <command>
given.
?|??
Function:
?|?? evaluates and displays the value of one or more expressions.
Syntax:
?|?? <expr list>
Remarks:
The single question mark issues a carriage return and line feed before
the expression list is displayed. The double question mark displays at
the current cursor position. The commas separating the expression list
output a single space in between expressions. If an expression consists
of a single MEMO field identifier, then dB Online will output the memo
contents word wrapped to the width set by SET MEMOWIDTH TO.
Example:
name = "John"
? "Hello there",name Hello there John
? "The date is "+ ctod(date()) The date is 10/21/93
? 5+3*6 23
See Also:
@...SAY, TEXT...ENDTEXT, LIST, DISPLAY
18
@...CLEAR
Function:
@...CLEAR is used to clear a rectangular area on the screen.
Syntax:
@ <nexpr1>,<nexpr2> CLEAR [TO <nexpr3>,<nexpr4>]
Remarks:
dB Online will clear to the current background color the space defined by
the 4 expressions. The line and row given by <nexpr1> and <nexpr2>
become the top left corner, and <nexpr3>, <nexpr4> become the bottom
right corner. If the second coordinates are not given then dB Online
will clear to the bottom right corner of the display.
See Also:
@...TO, CLEAR
@...SAY...GET
Function:
@...SAY ..GET is used to create full screen input forms. It disp
information at specific coordinates.
Syntax:
@ <nexpr1>,<nexpr2> [[SAY <expr> [PICTURE <cexpr>]]
[GET <var>|<field> [PICTURE <cexpr>] [RANGE <expr1>,<expr2>]]]
Remarks:
The output begins at the row and column positions specified by <nexpr1>
and <nexpr2>. For a 23*80 terminal the row coordinate can range from 0
to 22 and the column coordinate from 0 to 79.
The @...SAY command display information that you do not want to edit.
The value can be any valid dB Online expression. The value of <expr> is
evaluated and displayed at the row and column coordinates given.
The @...GET command displays and allows editing of data from existing
memory variables and fields. The READ command activates a full-screen
editing mode which allows the editing of multiple GET fields.
If an @...SAY...GET combination command is used, a single space is
entered between the display of the SAY expression and the GET input
field.
The RANGE option is used with numeric and date variables to specify
acceptable lower <expr1> and <expr2> lower bounds for input. If data is
entered outside the values specified by RANGE, dB Online will not accept
the input and request new data.
The PICTURE option allows formatting of the output expression and
restricts the type of data that may be entered into a variable. The
<cexpr> is called a PICTURE clause and may consist of a function and/or
a template.
19
If a PICTURE function is used, the @ symbol must be the first character
in the clause. If a PICTURE function is used with a picture template, a
space must separate the two.
dB Online provides the following PICTURE functions:
Symbol Valid Description
with type
C NUMERIC Display CR after a positive
number. (SAY only)
X NUMERIC Display DB after a negative
number. (SAY only)
( NUMERIC Enclose negative number in
parentheses. (SAY only)
B NUMERIC Left justifies numeric data.
(SAY only)
Z NUMERIC Displays zero numeric value as a
blank string. (SAY only)
D DATE MM/DD/YY
Use { } date format.
E DATE DD/MM/YY
Use { } date format.
A CHARACTER Allow only alphabetic characters.
(GET only)
! CHARACTER Converts all letters to
uppercase.
R CHARACTER Literal characters displayed in
template, but not entered in the
field.
S<n> CHARACTER Limits field width to <n>
characters. GETs will scroll
horizontally to access whole
field. <n> must be a literal
positive integer.
A PICTURE template is created by using a single symbol for each character
to be displayed or input. Any character may be used, but characters
other than the template symbols are considered literal characters.
If the R picture function is used for character input with a template
containing literal characters, the literals are inserted into the display
and not stored as part of the GET variable. If R is not used, the
literals are displayed instead of the corresponding string character and
are stored in the GET variable.
For numeric variables, literal characters are always inserted into the
display and not stored as part of the number.
20
dB Online provides the following template symbols:
Symbol Description
9 Allows digits for character and date
input. Allows digits and signs for
numeric data.
# Allows digits, blanks, and signs.
A Allows only alphabetic characters.
L Allows only logical characters: t,
T, f, F, y, Y, n, N.
Y Allows only logical characters: y,
Y, n, N.
N Allows alphanumeric characters.
X Allows any character.
! Converts letters to uppercase and
does not affect other characters
$ Displays dollar signs in place of
leading zeros for numeric data.
* Displays asterisks in place of
leading zeros for numeric data.
. Specifies the decimal position for
numeric data
, Displays if there are digits to the
left of the comma for numeric data.
If a PICTURE template is used to GET a decimal number, the decimal point
must be included in the template.
Example:
The following code provides examples of the @...SAY PICTURE command:
name = "John Smith"
@ 1,0 SAY name && Output name John Smith
@ 2,0 SAY name PICTURE '@!' && Convert to uppercase
JOHN SMITH
num1 = 456789
num2 = 23.78
num3 = -9.25
@ 3,0 SAY num1 456789
@ 4,0 SAY num1 PICTURE'$$$,$$$,$$$' $$$$456,789
@ 5,0 SAY num2 PICTURE'***,***.***' *****23,780
@ 6,0 SAY num3 PICTURE"@X *,***.**' ****9.25 DB
See Also:
?|??, APPEND BLANK, CLEAR, CLEAR GETS, COL(), READ, ROW(), SET BELL, SET
CONFIRM, SET DELIMITERS, SET INTENSITY, TEXT...ENDTEXT
@...TO
Function:
@...TO is used to draw a box with single or double lines.
Syntax:
21
@ <nexpr1>,<nexpr2> TO <nexpr3>,<nexpr4> [DOUBLE]
Remarks:
The row and column of the top left corner of the box are specified by
<nexpr1> and <nexpr2>. The bottom right corner are specified by <nexpr3>
and <nexpr4>. If both row coordinates are the same, a horizontal line is
drawn. If the column coordinates are the same, a vertical line is drawn.
The DOUBLE option draws a double line box instead of the default single
line box.
See Also:
@...CLEAR
ACCEPT
Function:
ACCEPT allows character input into a memory variable.
Syntax:
ACCEPT [<cexpr>] TO <var>
Remarks:
ACCEPT displays the optional prompt <cexpr> before waiting for user
input. The character input is then placed into <var>.
Example:
To input a users name:
ACCEPT "Please input your name :" TO name
? name
See Also:
@...SAY...GET, INPUT, WAIT
APPEND BLANK
Function:
APPEND BLANK allows a new record to be added to the end of the active
database file.
Syntax:
APPEND BLANK
Remarks:
The new record is blank and becomes the current record. Any open index
files are updated with the new record information.
This command cannot be used with read only files.
AVERAGE
Function:
AVERAGE calculates the arithmetic mean of numeric expressions in the
active database file.
22
Syntax:
AVERAGE [<scope>] <expr list> TO <var list> [WHILE <lexpr>] [FOR <lexpr>]
Remarks:
All records in the current database are averaged unless specified by the
<scope>, WHILE, or FOR clauses. The <expr list> items must correspond to
the memory variables in <var list>.
Example:
To AVERAGE the cost filed for all of John Smiths sales
USE sales
AVERAGE cost TO av_cost FOR salesman = "JS"
? av_cost
See Also:
COUNT, SUM
CANCEL
Function:
CANCEL stops the execution of the current dB Online session. dB Online
will close all files and return to the calling program (BBS etc.)
Syntax:
CANCEL
Remarks:
CANCEL will return a 0 to the DOS errorlevel.
See Also:
QUIT, RETURN
CLEAR
Function:
CLEAR erases both the local and remote screens. It also clears all
pending GET's.
Syntax:
CLEAR
Remarks:
The cursor is positioned at the top left hand corner of the screen after
execution.
See Also:
@...CLEAR, CLEAR GETS
CLEAR ALL
Function :
CLEAR ALL closes all open database files, index file, and memo files, and
selects work area 1.
Syntax:
23
CLEAR ALL
Remarks:
Memory variables are not cleared as in dBASE III+
See Also:
CLOSE
CLEAR GETS
Function:
CLEAR GETS releases all pending @...GET commands issued.
Syntax:
CLEAR GETS
See Also:
@...SAY...GET, CLEAR
CLEAR TYPEAHEAD
Function:
CLEAR TYPEAHEAD empties the type-ahead buffer.
Syntax:
CLEAR TYPEAHEAD
Remarks:
CLEAR TYPEAHEAD will only clear characters that have been received by the
local modem. There can be significant delay in receiving characters from
a remote terminal and CLEAR TYPEAHEAD will not clear characters in
transit.
CLOSE
Function:
CLOSE is used to close various file types.
Syntax:
CLOSE ALL|ALTERNATE|DATABASES|INDEX
Remarks:
CLOSE ALTERNATE will close the current alternate file. CLOSE DATABASES
will close all database, index and memo files and select work area 1.
CLOSE INDEX will close all index files in the current work area. CLOSE
ALL will close all the above file types.
See Also:
CLEAR ALL, RETURN, SET ALTERNATE TO, USE
CONTINUE
Function:
CONTINUE searches for the next record in current database as specified by
the conditions of the most recent LOCATE command.
24
Syntax:
CONTINUE
Remarks:
See the LOCATE command for details
See Also:
FOUND(), LOCATE, SEEK
COUNT
Function:
COUNT calculates the number of records in the current database that match
specified conditions.
Syntax:
COUNT [<scope>] [WHILE <lexpr>] [FOR <lexpr>] TO <var>
Remarks:
All records in the current database are counted unless specified by the
<scope>, WHILE, or FOR clauses.
Example:
To count all your Ontario customers
USE customer
COUNT FOR province = "ON" to number
? number
See Also:
AVERAGE, SUM
DELETE
Function:
DELETE marks records in the current database for deletion.
Syntax:
DELETE [<scope>] [WHILE <lexpr>] [FOR <lexpr>]
Remarks:
Unless otherwise specified DELETE marks only the current record for
deletion.
DELETE cannot be used with read only files.
Example:
USE customer
? DELETED() .F.
DELETE
? DELETED() .T.
See Also:
DELETED(), PACK, RECALL, SET DELETED
25
DISPLAY
Function:
DISPLAY is used to view the contents of the current database file.
Syntax:
DISPLAY [OFF] [<scope>] [<expr list>] [WHILE <lexpr>] [FOR <lexpr>]
Remarks:
The current record is displayed unless otherwise specified with the
<scope>, WHILE, or FOR expressions.
If <expr list> is not specified then all fields are displayed. The
record number is displayed unless the OFF option is included. A memo
field will be output in a word wrapped format only if it is explicitly
specified in <expr list>. The memo field will be output in a column
width defined by SET MEMOWIDTH TO.
See Also:
LIST, SET MEMOWIDTH
DO
Function:
DO executes a user defined procedure and passes optional parameters.
Syntax:
DO <proc name> [WITH <expr list>]
Remarks:
The <proc name> is defined with the PROCEDURE command. Program execution
passes to the corresponding procedure. After procedure execution,
program control passes to the command after the DO statement.
The WITH option allows parameter passing to the subroutine. The
parameter list can contain any valid expression. If a parameter is
specified as a single memory variable, any changes made to the variables
value in the subroutine will be reflected in the calling programs
variable.
Example:
The following program calculates the area of a circle.
area = 0
DO areacalc WITH 2 , area
? area 12.5663600
PROCEDURE areacalc
PARAMETERS radius, result
result = 3.14159 * radius^2
RETURN
See Also:
PARAMETERS, PRIVATE, PROCEDURE, RETURN, SET PROCEDURE
26
DO CASE
Function:
DO CASE is a structured programming command that chooses one alternative
from a set of choices.
Syntax:
DO CASE
CASE <lexpr>
<commands>
[CASE <lexpr]
<commands>
[...]
[OTHERWISE]
<commands>
ENDCASE
Remarks:
The <lexpr> following the CASE statements determine which set of
<commands> are executed. The <command> set corresponding to the first
<lexpr> to evaluate to True (.T.) will be executed. If none evaluate to
True (.T.) then the <commands> corresponding to the OTHERWISE condition
are executed if present. After a set of <commands> are executed, program
execution continues after the ENDCASE command.
See Also:
DO, DO WHILE, IF, IIF()
DO WHILE
Function:
DO WHILE is a structured programming command that allows a set of
commands to be executed based on a specified condition.
Syntax:
DO WHILE <lexpr>
<commands>
[EXIT]
<commands>
[LOOP]
<commands>
ENDDO
Remarks:
The <lexpr> following the DO WHILE statement determines whether the
<commands> in the structure are executed.
The EXIT command transfers program control to the command following the
ENDDO statement. It is often used with an IF...ENDIF structure.
The LOOP command transfers program control back to the DO WHILE
statement. The <lexpr> is then reevaluated and the <commands>
conditionally executed.
Example:
USE customer
DO WHILE .NOT. EOF()
27
....
DISPLAY
IF QUIT = .T.
EXIT
ENDIF
ENDDO
See Also:
DO, DO CASE, IF, RETURN
ERASE
Function:
ERASE deletes a file from the disk directory.
Syntax:
ERASE <filename> or
DELETE FILE <filename>
Remarks:
The file will be deleted if it exists on the drive.
Example:
To delete c:\sales\customer.txt
file = "c:\sales\customer.txt"
ERASE &file
GO|GOTO
Function:
GO|GOTO positions the record pointer to a specific record in the active
database file.
Syntax:
[GO|GOTO] <nexpr> or
GO|GOTO TOP|BOTTOM
Remarks:
If the [GO|GOTO] optional command is not specified then <nexpr> must
begin with a numeric constant.
If an index file is active GO TOP|BOTTOM refer to the top and bottom
logical records in the index file. GO|GOTO <nexpr> always refers to a
specific record number. If SET DELETED is ON, you may access a record
marked for deletion by directly specifying its record number.
Example:
USE customer
GO TOP
? RECNO() 1
5
? RECNO() 5
See Also:
RECNO(), SKIP
28
IF
Function:
IF is a structured programming command that allows the conditional
execution of commands.
Syntax:
IF <lexpr>
<commands>
[ELSE]
<commands>
ENDIF
Remarks:
If <lexpr> is evaluated to True (.T.) then the first set of <commands>
are executed and program control is transferred to the ENDIF statement.
If <lexpr> is evaluated to False (.F.) then dB Online transfers program
control to the ELSE statement or the ENDIF statement if the ELSE
statement is omitted.
See Also:
DO CASE, IIF()
INPUT
Function:
INPUT is used to input numeric information from the keyboard.
Syntax:
INPUT [<cexpr>] TO <var>
Remarks:
The optional <cexpr> is displayed as a prompt for input. The value
returned to the <var> is the numeric value of the characters inputted.
Example:
INPUT "Type in your age " TO age && If 28 is entered
? age 28
See Also:
ACCEPT, WAIT
LIST
Function:
LIST is used to view the contents of the current database file.
Syntax:
LIST [OFF] [<scope>] [<expr list>] [WHILE <lexpr>] [FOR <lexpr>]
Remarks:
All records are listed unless otherwise specified with the <scope>,
WHILE, or FOR expressions.
If <expr list> is not specified then all fields are displayed. The
record number is displayed unless the OFF option is included.
29
A memo field will be output in a word wrapped format only if it is
explicitly specified in <expr list>. The memo field will be output in a
column width defined by SET MEMOWIDTH TO.
See Also:
DISPLAY, SET MEMOWDTH
LOCATE
Function:
LOCATE scans the active database for records that satisfy specified
conditions.
Syntax:
LOCATE [<scope>] [WHILE <lexpr>] [FOR <lexpr>]
[CONTINUE]
Remarks:
LOCATE searches the entire database unless otherwise specified with the
<scope>, WHILE, or FOR expressions.
LOCATE will find the first record to match the specified conditions. If
this record is found then FOUND() returns .T. Use CONTINUE to find the
next occurrence of the specified conditions.
When the record counter reaches the end of the file or the end of the
<scope> then FOUND() returns .F.
You can have a different LOCATE/CONTINUE for each work area. The most
recent LOCATE in any work area overrides any previous.
See Also:
CONTINUE, FOUND(), SEEK
NOTE
Function:
NOTE is used to indicate comments in the source code.
Syntax:
NOTE|* <text>
[<command>]&& <text>
Remarks:
The <text> indicated above is ignored by the compiler. If any comment
line ends with a semicolon, then the next line is also treated as a
comment.
&& is used to insert a comment on the same line as a command.
Example:
USE customer.dbf && open customer database
NOTE List all data
LIST
30
ON ERROR
Function:
ON ERROR is used to enable runtime error handling.
Syntax:
ON ERROR [DO <proc name> [WITH <expr list>]]
Remarks:
ON ERROR responds to dB Online database errors as outlined in APPENDIX 3.
When a runtime error occurs, program control will transfer to the
procedure <proc name> defined in the ON ERROR command. To disable error
trapping enter ON ERROR <Enter> without a DO command.
In the procedure the function ERROR() will identify the error which
occurred and the function MESSAGE() will return a character message of
the error which occurred.
If the error recovery procedure ends with a RETRY command, the same
command which generated the error will be executed. However RETRY will
not attempt to re-execute any conditional commands such as IF, WHILE,
CASE etc.
Example:
The following program will recover from the error: File is already open.
ON ERROR DO recover
<commands>
USE customer
<commands>
RETURN
PROCEDURE recover
IF ERROR() = 3
CLOSE DATABASES
RETRY && attempt to USE again
ENDIF
RETURN
See Also:
INKEY(), ON ESCAPE
ON ESCAPE
Function:
ON ESCAPE responds to the user pressing E.
Syntax:
ON ESCAPE [DO <proc name> [WITH <expr list>]]
Remarks:
When the user presses <Esc> during program execution, program control
will be transferred to the procedure <proc name> define in the ON ESCAPE
DO command. ON ESCAPE only works when SET ESCAPE is ON. To disable
error trapping enter ON ESCAPE <Return> without a DO command.
31
During the execution of the ON ESCAPE procedure, escape key trapping is
disabled.
Example:
This example allows the user to cancel a long listing:
USE customer
SET ESCAPE ON
ON ESCAPE DO if_esc
LIST
RETURN
PROCEDURE if_esc
ACCEPT "Do you want to quit (Y/N)" TO response
IF 'Y' $ UPPER(response)
RETURN
ELSE
RETRY
ENDIF
See Also:
INKEY(), ON ERROR, READKEY(), SET ESCAPE
PACK
Function:
PACK permanently removes all record marked for deletion in the active
database file.
Syntax:
PACK
Remarks:
All open index files are automatically REINDEXed and all memofiles area
automatically compressed.
PACK cannot be used with read only files.
See Also:
DELETE, RECALL, REINDEX
PARAMETERS
Function:
PARAMETERS assigns local variable names to data items passed from a
calling program.
Syntax:
PARAMETERS <var list>
Remarks:
The PARAMETERS command must follow the PROCEDURE <proc name> command.
The <var list> corresponds to the <expr list> from the calling program.
All variables identified in the PARAMETERS list are private to that
procedure. When the procedure ends, the PARAMETER variables are
released.
32
See Also:
DO, PRIVATE, PROCEDURE , PUBLIC, SET PROCEDURE
PRIVATE
Function:
PRIVATE creates new memory variables in a lower-level subroutine.
Syntax:
PRIVATE <var list>
Remarks:
Any changes made to private memory variables do not affect other
variables of the same name in higher level procedures. When a procedure
containing a private memory variable ends, the value hidden by PRIVATE
variable are then available. Any variables defined in a PARAMETERS list
are PRIVATE for that subroutine.
See Also:
DO, PARAMETERS, PUBLIC
PROCEDURE
Function:
PROCEDURE identifies the beginning of a procedure subroutine definition.
Syntax:
PROCEDURE <proc name>
[PARAMETERS <var list>]
<commands>
Remarks:
Procedures can be placed after the main program or in separate procedure
files. These procedure files are identified in the main program with the
SET PROCEDURE TO command.
The optional PARAMETERS variable list indicate PRIVATE memory variables
corresponding to the parameters passed with DO <proc name> WITH <expr
list>.
A RETURN statement is used to terminate PROCEDURE execution. If the
RETURN statement is not included, one is assumed before the next
PROCEDURE command or the end of file.
Example:
The following program calculates the area of a circle.
area = 0
DO areacalc WITH 2 , area
? area 12.5663600
PROCEDURE areacalc
PARAMETERS radius, result
result = 3.14159 * radius^2
RETURN
See Also:
33
DO, PARAMETERS, SET PROCEDURE
PUBLIC
Function:
PUBLIC makes memory variables globally available.
Syntax:
PUBLIC <var list>
Remarks:
All variables defined in your program are considered PUBLIC unless they
are declared as private within a subroutine using the PARAMETERS or
PRIVATE command.
See Also:
PARAMETERS, PRIVATE
QUIT
Function:
QUIT stops the execution of the current dB Online session. dB Online
will close all files and return to the calling program (BBS etc.)
Syntax:
QUIT
Remarks:
QUIT will return a 0 to the DOS errorlevel.
See Also:
CANCEL, RETURN
READ
Function:
READ activates all @...GETs issued since the last CLEAR, CLEAR ALL, CLEAR
GETS, or READ.
Syntax:
READ [SAVE]
Remarks:
READ allows the user to enter data into multiple fields on a single input
screen. The fields are defined by @...GET commands. The user is allowed
to tab through the input fields in order to enter information. The full
screen editing keys are defined in APPENDIX 4.
READ clears all GETs after editing is finished. The SAVE option does not
clear the GETs, they will be active when the next READ command is issued.
If an @...GET is issued with a field of a read only file, then the read
command will allow the user to browse through the data but not change any
values.
Example:
34
To allow a user to enter his name with a maximum of 12 characters. The
first character will be forced to uppercase.
name = SPACE(12)
@ 3,3 SAY "Enter your name: " GET name PICTURE "!XXXXXXXXXXX"
READ
See Also:
@...SAY...GET, CLEAR, CLEAR GETS
RECALL
Function:
RECALL unmarks records in the current database that have been marked for
deletion.
Syntax:
RECALL [<scope>] [WHILE <lexpr>] [FOR <lexpr>]
Remarks:
Unless otherwise specified RECALL unmarks only the current record.
RECALL cannot be used with read only files.
Example:
USE customer
? DELETED() .T.
RECALL
? DELETED() .F.
See Also:
DELETE, DELETED(), PACK, SET DELETED
REINDEX
Function:
REINDEX rebuilds all active index files in the current work area.
Syntax:
REINDEX
Remarks:
Only index files that have been opened with the corresponding database
file will be rebuilt.
REINDEX cannot be used with read only files.
See Also:
PACK, SET INDEX, USE
RENAME
Function:
RENAME changes the name of a file on disk.
Syntax:
35
RENAME <filename1> TO <filename2>
Remarks:
If drive specifiers are used, they must both indicate the same drive.
RENAME cannot be used to copy files to different drives.
REPLACE
Function:
REPLACE changes the contents of specified fields in the current database.
Syntax:
REPLACE [<scope>] <field> WITH <expr> [,<field> WITH <expr> ...]
[WHILE <lexpr>] [FOR <lexpr>]
Remarks:
REPLACE only changes the current record unless otherwise specified by the
<scope>, WHILE or FOR expressions.
The <field> and WITH <expr> must have the same data type.
If replacements are made on a key field of an index file will update the
index file if it's in use. Thus the <scope>, WITH, and FOR conditions
will not operate properly as the record order will change as the records
are replaced. The records should be replaced in natural order when
replacing more than a single record.
REPLACE cannot be used with read only files.
Example:
To raise all product costs by 10%:
USE product INDEX part_no
SET ORDER TO 0 && Record ordering
REPLACE ALL part_no WITH part_no * 1.10
RESTORE
Function:
RESTORE retrieves memory variables from a memory file.
Syntax:
RESTORE FROM <filename>
Remarks:
A .mem file extension is assumed unless otherwise specified.
Any current memory variables with the same name as those being restored
are overwritten. The RESTORed variables will have the same scope
(PUBLIC, PRIVATE) as when the were SAVEed.
All current memory variables are retained when using RESTORE.
Example:
variable = "Hello"
SAVE TO memory
variable = ""
36
RESTORE FROM memory
? variable Hello
See Also:
SAVE, STORE
RETRY
Function:
RETRY completes subroutine execution and returns program control to the
command that called the subroutine.
Syntax:
RETRY
Remarks:
RETRY is used mainly in error recovery where it can repeat a command
until it is successfully executed. RETRY will re-execute the command
that called the current subroutine. This is in contrast to the RETURN
command that executes the command after the calling command.
If a runtime error occurs in a program that has a routine defined by ON
ERROR DO, then RETRY can be used to re-attempt the erroneous command when
the error conditions are corrected.
Example:
The following program will recover from the error: File is already open.
ON ERROR DO recover
<commands>
USE customer
<commands>
RETURN
PROCEDURE recover
IF ERROR() = 3
CLOSE DATABASES
RETRY && attempt to USE again
ENDIF
RETURN
See Also:
ERROR(), ON ERROR, RETURN
RETURN
Function:
RETURN completes procedure execution and returns program control to the
calling program. The command after the calling command is then executed.
Syntax:
RETURN [TO MASTER]
Remarks:
The TO MASTER option will return program control to the highest level
calling program. This allows a simple method of RETURNing from nested
procedures.
37
If the RETURN command is not included at the end of a program or
procedure file a RETURN is assumed before the next PROCEDURE statement or
the end of file.
RETURN releases all PRIVATE variables of a procedure.
See Also:
DO, PRIVATE
RUN
Function:
RUN executes a DOS command from within dB Online.
Syntax:
RUN|! <dos command>
Remarks:
All parameters must be included in <dos command> above. There must be
enough memory to shell another version of COMMAND.COM
RUN is only available in the Registered and Pro versions of dB Online.
Example:
To download a file using DSZ.exe with dB Online.
file = "data.zip"
command = "dsz " + file
? "Please start you zmodem download"
RUN &command
SAVE
Function:
SAVE stores all or part of the current set of memory variables to a disk
file.
Syntax:
SAVE TO <filename> [ALL LIKE|EXCEPT <var name spec>]
Remarks:
The default extension for <filename> is .MEM unless otherwise specified.
If the ALL LIKE|EXCEPT option is not used then all current variables are
saved to disk.
In <var name spec>, a question mark (?) masks a single character and an
asterisk (*) masks any number of characters.
Example:
To SAVE all memory variables beginning with 'user' to file.mem
SAVE TO file ALL LIKE user*
See Also:
RESTORE, STORE
38
SEEK
Function:
SEEK searches for the first record in the active index of the current
database whose key matches a specified expression.
Syntax:
SEEK <cexpr>|<dexpr>|<nexpr>
Remarks:
The expression must have the same data type as the active index key.
For character searches, the result of the search depends on the setting
of SET EXACT. If SET EXACT is ON the key expression would have to match
the full length of the index key. However with SET EXACT OFF a partial
string will match the first occurrence in a index key.
If the search is successful the FOUND() flag is set to True(.T.). If the
search is unsuccessful the record pointer moves to the end of the file
and FOUND() is set to False (.F.).
Example:
USE customer INDEX name
SET EXACT OFF
SEEK "Smi"
? name Smith
SET EXACT ON
SEEK "Smi"
? FOUND() .F.
See Also:
EOF(), FOUND(), LOCATE, SET DELETED, SET INDEX, SET EXACT, SET ORDER, USE
SELECT
Function:
SELECT chooses a work area from the twenty available work areas.
Syntax:
SELECT <integer>|<alias>
Remarks:
Work areas are <integers> numbered from 1 to 20, or A through J (Alpha
aliasing can only access the first 10 work areas). When you start up
your dB Online application, the active work area is one. Only dB Online
Pro has access to more than a single work area.
Each work area can contain one open database file and it's associated
index and memo files. You can use SELECT to change work areas so that
the database in the new work area becomes the active database file.
You can also use SELECT by specifying the <alias> of a work area. This
<alias> is specified when the database is opened with the USE...ALIAS
command. If the ALIAS command is not used then the database filename
minus the extension is the default alias name.
39
Each work area maintains its own record pointer and moving between work
areas does not affect the position of any record pointers. All work
areas operate independently of each other unless related with SET
RELATION TO.
Fields in the current work are accessed by simply indicating their field
name. To access fields from other work areas you can specify fields in
other work areas by using the aliasing indicator:
alias->field or alias.field
Example:
SELECT a
USE customer
? name Smith
SELECT 2
USE sales
? a->name
Outputs: Smith
? subtotal 23.45
See Also:
SET INDEX, USE
SET ALTERNATE
Function:
SET ALTERNATE records all output other than that of full-screen commands
to a text file.
Syntax:
SET ALTERNATE on/OFF
SET ALTERNATE TO [<filename>]
Remarks:
SET ALTERNATE is OFF by default.
This command consists of two parts:
SET ALTERNATE TO <filename> creates and opens an ALTERNATE file. It
overwrites any file with the same name. A .TXT file extension is assumed
unless otherwise specified.
SET ALTERNATE ON starts recording of text output to the text file. Full
screen commands such as @..SAY...GET are not recorded.
SET ALTERNATE OFF suspends the recording of output to the file without
closing the file. Recording can be restarted with SET ALTERNATE ON.
The file is closed with the SET ALTERNATE TO command or the equivalent
CLOSE ALTERNATE.
Example:
To flag a file to be downloaded in PCBoard:
file = "program.zip"
SET ALTERNATE TO pcbstuff.kbd
SET ALTERNATE ON
40
SET CONSOLE OFF && To avoid output to screen
?? "FLAG " + file
?
SET CONSOLE ON
SET ALTERNATE TO &&Closes pcbstuff.kbd
See Also:
CLOSE
SET BELL
Function:
SET BELL determines whether a bell is sounded when an invalid data type
is entered in an entry field or the end of an input area is reached.
Syntax:
SET BELL ON|off
Remarks:
SET BELL is ON by default
See Also:
@...SAY...GET, SET CONFIRM
SET CENTURY
Function:
SET CENTURY allows the input and display of centuries in the year portion
of dates.
Syntax:
SET CENTURY on|OFF
Remarks:
SET CENTURY is OFF by default.
Date display and entry will only allow for 6 significant digits when SET
CENTURY is OFF. Thus all dates entered will default to the twentieth
century. However any date calculation that result in non-twentieth
century dates will be stored with the correct century.
With SET CENTURY ON date display and entry will allow 8 significant
digits. Thus century information can be fully specified.
Example:
? DATE() 10/21/93
SET CENTURY ON
? DATE() 10/21/1993
See Also:
CTOD(), DATE(), DTOC(), YEAR()
SET COLOR
Function:
41
SET COLOR allows custom color selection for both standard and enhanced
output.
Syntax:
SET COLOR TO [<standard>[,<enhanced>]]
Remarks:
SET COLOR is only operational in ANSI terminal operation. The <standard>
colors are used for normal text output and the <enhanced> colors are used
for @...GET input fields and error message outputs.
The default colors upon startup are: Standard: White on Black
Enhanced: Black on White
SET COLOR TO <Enter> will re-select the default colors.
The <standard> and <enhanced> colors are specified as follows:
Color Letter Intense Letter
Code Color Code
Black N or blank Dark Gray N+
Blue B Light Blue B+
Red R Light Red R+
Green G Light G+
Green
Cyan BG Light Cyan BG+
Magenta RB Light RB+
Magenta
Brown GR Yellow GR+
Light GrayRGB or W White RGB+ or W+
Blank X Flashing *
Foreground and background colors are separated by a slash (/). The
intense colors are only available in the foreground. If an asterisk (*)
is present then the output will be flashing.
The Blank (X) color specifier will output blank characters. This is
useful for password entry.
Examples:
The following SET COLOR commands are explained:
* Standard: Yellow on a Red background. Enhanced: White on a Red background.
SET COLOR TO GR+/R,W/R
* Standard: White on a Blue background. Enhanced: Black on a Cyan background.
SET COLOR TO W+/B,N/BG
See Also:
ISCOLOR(), SET INTENSITY
42
SET CONFIRM
Function:
SET CONFIRM determines whether the cursor moves automatically to the next
entry field when the current field is full. This command affects only
full screen functions.
Syntax:
SET CONFIRM on|OFF
Remarks:
SET CONFIRM is OFF by default. This causes the cursor to automatically
advance from one field to the next in a full screen @...GET READ
command.
SET CONFIRM ON causes the cursor to remain in the field until the <Enter>
key is pressed.
See Also:
@...SAY...GET, SET BELL
SET CONSOLE
Function:
SET CONSOLE determines whether output is sent to the local and remote
terminals.
Syntax:
SET CONSOLE ON|off
Remarks:
SET CONSOLE is ON by default. This causes all output to be sent to the
local and remote terminals.
SET CONSOLE OFF does not send output to either local or remote terminals.
This is useful for writing files to disk with SET ALTERNATE.
See Also:
SET ALTERNATE
SET DECIMALS
Function:
SET DECIMALS determines the minimum number of decimals to display for the
results of numeric calculations.
Syntax:
SET DECIMALS TO <nexpr>
Remarks:
SET DECIMALS is set to 2 by default.
SET DECIMALS applies to division, exponents, EXP(), LOG(), SQRT() and
VAL() functions. If SET FIXED is ON, SET DECIMALS applies to all numeric
output.
43
Example:
SET DECIMALS TO 2
? 1/4 0.25
? 1/4.000 0.250
? SQRT(3.452) 1.86
SET DECIMALS TO 5
? 1/4 0.25000
See Also:
SET FIXED
SET DEFAULT
Function:
SET DEFAULT determines the default drive to where all operations take
place and files are stored unless otherwise specified.
Syntax:
SET DEFAULT TO <drive>
Remarks:
SET DEFAULT is set to the drive that dB Online was started up from.
SET DEFAULT does not check if the given disk drive exists and it does not
change the default drive when dB Online exits.
Example:
To set the default drive to D:
SET DEFAULT TO d
See Also:
SET PATH
SET DELETED
Function:
SET DELETED determines whether records marked for deletion are included
in the execution of dB Online commands.
Syntax:
SET DELETED on|OFF
Function:
SET DELETED is OFF by default.
With SET DELETED ON, most commands will not recognize records marked for
delete as part of the database. Commands like LOCATE or LIST will not
display deleted records. Commands that specify a record number using
RECORD <n> or GO|GOTO <n> will included deleted records.
See Also:
DELETE, DELETED(), RECALL
44
SET DELIMITERS
Function:
SET DELIMITERS determines how fields are indicated in full-screen editing
mode.
Syntax:
SET DELIMITERS on|OFF
SET DELIMITERS TO [<cexpr>|DEFAULT]
Remarks:
SET DELIMITERS is OFF by default. This causes entry fields not to be
enclosed by delimiter characters. If SET INTENSITY is ON, entry fields
are display in enhanced colors.
SET DELIMITERS ON will enclose entry fields by the default delimiters of
colons (:).
SET DELIMITERS TO <cexpr> changes the default delimiter characters. If a
single character is specified then it is used to delimit both the
beginning and end of the entry field. If two characters are specified
then the first marks the beginning and the second marks the end. Any
extra characters are ignored.
SET DELIMITERS TO DEFAULT returns the delimiters to colons (:)
See Also:
@...SAY...GET, SET INTENSITY
SET ESCAPE
Function:
SET ESCAPE determines whether pressing <Esc> terminates
execution.
Syntax:
SET ESCAPE ON|off
Remarks:
SET ESCAPE is ON by default. This causes the dB Online program to
terminate when the user presses the <Esc> key. Escape key trapping with
ON ESCAPE is only available with SET ESCAPE ON.
With SET ESCAPE OFF the <Esc> key does not terminate program execution.
The keypress may be determined like any other keypress with the INKEY()
function.
See Also:
INKEY(), ON ESCAPE, READKEY()
45
SET EXACT
Function:
SET EXACT determines whether a comparison between two character strings
requires an exact match.
Syntax:
SET EXACT on|OFF
Remarks:
SET EXACT is OFF by default. This causes character string comparisons to
be True (.T.) if the strings are identical up to the length of the second
string.
With SET EXACT ON the character strings must be exactly the same before a
True (.T.) is returned.
SET EXACT also applies to the SEEK command with character index keys.
Examples:
SET EXACT OFF
? "abc" = "abcdef" .F.
? "abcdef" = "abc" .T.
SET EXACT ON
? "abcdef" = "abc" .F.
See Also:
LOCATE, SEEK, =
SET EXCLUSIVE
Function:
SET EXCLUSIVE allows the shared use of database file on a multi-user
system.
Syntax:
SET EXCLUSIVE ON/off
Remarks:
SET EXCLUSIVE is ON by default. This means that all data files are
opened in exclusive mode. Any other user attempting to open the will
receive an error.
SET EXCLUSIVE OFF enables multi-user access to the database files. dB
Online will provide file and record locking for database files in a
method native to your DataBase Management System.
See Also:
FLOCK(), LOCK(), RLOCK(), SET LOCK, SET REPROCESS, UNLOCK, USE
SET FILTER
Function:
SET FILTER allows only records that meet a specified condition to be
displayed.
46
Syntax:
SET FILTER TO [<lexpr>]
Remarks:
All commands that access database records can be used with the SET FILTER
TO <lexpr> condition.
SET FILTER only applies to the current database work area. Thus a
different condition may be set for each work area.
All records for which <lexpr> is True (.T.) are available for processing
and any for which <lexpr> is False (.F.) are ignored.
Filter conditions are not valid until the record pointer is moved after
the SET FILTER TO command is executed. You must move your record pointer
with GOTO TOP or SKIP to ensure the filter condition is valid.
SET FILTER TO <Cr> turns of a filter for the current work area. A
records are then available for processing.
Example:
To count the number of customers in New York:
USE customer
SET FILTER TO state = "NY"
COUNT TO number
To total all sales in October 1993:
USE sales
SET FILTER TO MONTH(saledate) = 10 .AND. YEAR(saledate) = 1993
SUM price * quantity TO total
See Also:
SET DELETED
SET FIXED
Function:
SET FIXED determines whether a fixed number of decimal places are
displayed for all numeric output.
Syntax:
SET FIXED on|OFF
Remarks:
SET FIXED is OFF by default. This causes the number of decimal places
for numeric output to be as explained in the SET DECIMALS command.
If SET FIXED is ON all numeric output will have the number of decimal
places identified by SET DECIMALS TO.
See Also:
SET DECIMALS
47
SET INDEX
Function:
SET INDEX opens specified index files in the current work area.
Syntax:
SET INDEX TO [<filename> [,<filename>]...]
Remarks:
The default file extension is determined by which database file
compatibility you have chosen with dB Online. For dBASE III+ file
compatibility the default extension is .NDX, for Clipper: .NTX
, for dBASE
IV: .MDX, and for FoxPro: .CDX
SET INDEX closes all indexes in the current work area before opening the
ones specified in the file list. SET INDEX TO <Cr> will close all index
file in the current work area and is equivalent to CLOSE INDEX.
The first tag of the first index file specified becomes the master index
for the current database (Tags do not apply to dBASE III+ and Clipper
file compatibility). The master index determines the record order as
well as the search key for the SEEK command. The record pointer is
positioned at the first logical record of the index key.
All open index files are updated when changes are made to a database
file.
See Also:
SET ORDER, USE
SET INTENSITY
Function:
SET INTENSITY determines whether the enhanced screen colors are used for
full screen data entry fields.
Syntax:
SET INTENSITY ON/off
Remarks:
SET INTENSITY is ON by default. This causes all full screen data entry
fields (@...GETs) to be displayed in the enhanced screen color as
determined by SET COLOR TO. All other text output is displayed in the
standard screen color.
If SET INTENSITY is OFF, then the standard screen color is used for all
data output.
See Also:
@...SAY...GET, SET COLOR, SET DELIMITERS
48
SET LOCK
Function:
SET LOCK allows the current record of a database file to be locked before
reading.
Syntax:
SET LOCK on/OFF
Remarks:
SET LOCK is OFF by default. This mean that records are not locked as
they are read into the record buffer. This allows users to view the same
record simultaneously.
With SET LOCK ON, any record is automaticallly locked before reading.
This ensures that there can be no changed to the data once it is read.
While this greatly simplifies creating multi-user applications. It
increases the chances that another user will have to wait for a record if
he only wants to view it.
See Also:
FLOCK(), LOCK(), RLOCK(), SET EXCLUSIVE, SET REPROCESS, UNLOCK
SET MEMOWIDTH
Function:
SET MEMOWIDTH determines the width for memo field output.
Syntax:
SET MEMOWIDTH TO <nexpr>
Remarks:
SET MEMOWIDTH TO has a default value of 50 by default. The minimum value
is 8 characters.
All memo output using the ? |?? or LIST|DISPLAY commands will be word
wrapped within a column width defined by SET MEMOWIDTH TO.
SET ORDER
Function:
SET ORDER sets up an open index file as the master index.
Syntax:
SET ORDER TO [<nexpr> | TAG <tag>]
Remarks:
SET ORDER TO changes the master index from the available index tags.
If SET ORDER TO <nexpr> is used then the master index becomes the tag
corresponding to the value of <nexpr>. For dBASE III+ and Clipper file
compatibility this number corresponds to the index file on the
USE...INDEX or SET INDEX TO list. For dBASE IV and FoxPro compatibility
it corresponds to the all the tags of the index file list.
49
If SET ORDER TO TAG <tag> is used then a search is made for the first tag
whose name matches <tag>. The tag names for dBASEIII and Clipper index
files correspond to the index file names without the filename extension.
SET ORDER TO 0 returns the database to natural record ordering.
See Also:
CDX(), MDX(), NDX(), SET INDEX
SET PATH
Function:
SET PATH determines the directories dB Online will search to find files
not in the current directory.
Syntax:
SET PATH TO [<path list>]
Remarks:
By default dB Online only searches the current directory. If a <path
list> is specified dB Online will search for a file in the current
directory first and then in the directories specified.
The <path list> consists of a list of paths separated by commas (,) or
semi-colons (;).
SET PATH applies only to commands that search for existing files. If you
create a file it will be saved in the current directory unless the you
specify the path with the filename.
Examples:
The following program will search in two directories if a file cannot be
found in the default directory.
SET PATH TO c:\dbonline\databases,c:\foxpro\files
use customer
See Also:
FILE(), SET DEFAULT
SET PROCEDURE
Function:
SET PROCEDURE is used to include procedure files while a source file is
being compiled.
Syntax:
SET PROCEDURE TO [<filename>]
Remarks:
SET PROCEDURE TO specifies filenames to be included with the current main
file. All source files are compiled and a single .DBX file is created.
Thus it is not necessary to CLOSE PROCEDURE files. The SET PROCEDURE TO
command is not present at runtime.
See the Compiling section for more details on SET PROCEDURE.
50
See Also:
DO, PARAMETERS
SET RELATION
Function:
SET RELATION links two open database files according to a key expression
that is common to both files.
Syntax:
SET RELATION TO [<key expr>|<nexpr> INTO <alias>]
Remarks:
SET RELATION TO links the active database file to an open database file
in another work area. The INTO file is identified by its alias. Only
one relation can be made from each work area. The active database file
is called the parent file, and the INTO file is called the child file.
If a <key expression> is used then the child database must be indexed.
The <key expression> is evaluated and then a seek is performed on the
child work area. The child database is position to the first record that
matches the key expression.
When the <nexpr> is used, and the child database is not indexed, then the
child database is positioned to the record number given by <nexpr>.
If no record is found then the child database is positioned to the end of
file and EOF() will return True (.T.).
As the parent and child files must be in separate work areas, SET
RELATION is only available in the Pro version of dB Online.
Example:
If the invoice database has a field inv_no which matches the same field
in sales we can set the following relation:
SELECT a
USE invoice.dbf
USE sales INDEX inv_no.ndx IN 2 && open sales in work area b
SELECT a
SET RELATION TO inv_no INTO b
LIST inv_no, customer, b->product, b->sales && output related fieldS
See Also:
SET INDEX, SET ORDER
SET REPROCESS
Function:
SET REPROCESS determines how may times dB Online will attempt to access a
locked record before returning an error.
Syntax:
SET REPROCESS TO <nexpr>
Remarks:
51
SET REPROCESS is set to -1 by default. This means that dB Online will
attempt to open the locked data approximately every second indefinately.
Once the data is available, then dB Online will proceed with program
execution.
If SET REPROCESS is set to any non-negative value, dB Online will attempt
to open the locked data <nexpr> times. These open attempts will occur at
approximately one second intervals. If SET REPROCESS is set to 0 then dB
Online will immediately return a locking error.
See Also:
FLOCK() , LOCK(), RLOCK(), SET LOCK, SET EXCLUSIVE, UNLOCK
SKIP
Function:
SKIP moves the record pointer forward or backward in the current database
file.
Syntax:
SKIP [<nexpr>]
Remarks:
SKIP uses the natural record order when moving the record pointer, unless
there is an active index file in use, then SKIP follows the index file
order.
SKIP moves the record pointer by the value of <nexpr>. Both positive and
negative values of <nexpr> are allowed with negative values moving the
record pointer backwards. If <nexpr> is omitted, then the record pointer
is moved a single record forward.
If SKIP is used with a positive value when the record pointer is at the
last record in the database, then the EOF() condition will be True (.T.).
If SKIP is used with a negative value when the record pointer is at the
first record in the database, then the BOF() condition will be True
(.T.).
Example:
USE customer
SKIP
? RECNO() 2
SKIP 15
? RECNO() 17
SKIP -5
? RECNO() 12
See Also:
BOF(), EOF(), GOTO
STORE
Function:
STORE creates and assigns values to one or more memory variables.
52
Syntax:
STORE <expr> TO <var list> or
<var> = <expr>
Remarks:
The value of <expr> is assigned to all the variables in <var list> when
using the STORE command. With the alternate syntax, only a single
variable may be assigned at a time.
You can not assign values to fields using the STORE command. You must
use the REPLACE command.
Example:
STORE 0 TO a,b,c && initialize a, b, c to zero
name = "Smith" && STORES 'Smith' to variable name
See Also:
PRIVATE, PUBLIC
SUM
Function:
SUM calculates the total of numeric expressions in the active database
file.
Syntax:
SUM [<scope>] <expr list> TO <var list> [WHILE <lexpr>] [FOR <lexpr>]
Remarks:
All records in the current database are totaled unless specified by the
<scope>, WHILE, or FOR clauses. The <expr list> items must correspond to
the memory variables in <var list>.
Example:
To output the total sales by John Smith:
USE sales
SUM quantity * price TO total FOR salesman = "JS"
? total
See Also:
AVERAGE, COUNT
TEXT
Function:
TEXT is used to output blocks of text to the screen.
Syntax:
TEXT
<text>
<text>
...
ENDTEXT
Remarks:
53
The text is output exactly as it appears in the source file. The first
text line that begins with ENDTEXT will terminate the output text.
Example:
To output a short menu to the screen.
CLEAR
TEXT
[S] Search
[L] List
[Q] Quit
[?] Help
Please enter your selection:
ENDTEXT
See Also:
?|??, @...SAY, DISPLAY, LIST
UNLOCK
Function:
UNLOCK removes locks previously placed on a datafile using FLOCK(),
LOCK(), or RLOCK().
Syntax:
UNLOCK
Remarks:
UNLOCK will unlock the file in the current work area. UNLOCK allows
other users to access all the information in a database file. It should
be used after the commands that required file or record locking are
completed.
Example:
USE customer.dbf
IF FLOCK() && if lock is successful
PACK
UNLOCK && unlock file after PACKing.
ELSE
? "Unable to lock file"
QUIT
ENDIF
See Also:
FLOCK(), LOCK(), RLOCK(), SET EXCLUSIVE, SET LOCK, SET REPROCESS
54
USE
Function:
USE opens an existing database file and any specified index files. If
the database includes memo fields, then the corresponding memo file is
opened.
Syntax:
USE [ <filename> ] [INDEX <index file list>
<integer>]
Remarks:
Unless otherwise specified dB Online assumes a .DBF extension for the
database file while the default index file extension is dependent on the
file compatibility in use.
All index files in the <index file list> are opened with the database
file. In dBASE IV and
FoxPro file compatibility if there is a production
index file associated with the database file it is opened automatically.
USE <Cr> will close the database and index files in the
selected work area.
If the ALIAS option is omitted , then dB Online will use the database
filename minus the extension for the ALIAS.
The files are opened in the currently selected work area. If the IN
command is used, then dB Online switches to the specified work area
before attempting to open any files.
Example:
SELECT 1
USE customer && open customer.dbf in work area 1
USE sales INDEX part_no IN 2 && open sales in work area 2
SELECT customer && select customer.dbf using alias
See Also:
CLOSE, SELECT, SET EXCLUSIVE, SET INDEX
WAIT
Function:
WAIT pauses until a single key in input on either the remote or local
terminals.
Syntax:
WAIT [<cexpr>] [TO <var>]
Remarks:
WAIT displays the optional prompt <cexpr> before waiting for a user
keypress. If no prompt is specified then "Press any key to continue..."
is displayed.
If the optional <var> is specified then the character input is placed
into <var>. If <Cr> or other non-printable character is entered, a null
string is assigned to <var>.
55
Example:
WAIT 'Do you wish to continue (Y/N)' TO answer
IF UPPER(answer) = 'N'
QUIT
ENDIF
See Also:
ON ESCAPE
56
Database Functions
&
Function:
& is the macro substitution function. It substitutes the contents of a
character memory variable for another variable name or a file name.
Syntax:
&<var>
Return Value:
<var>|<field>|<filename>
Remarks:
The contents of <var> will specify either another variable/field
identifier or a file name to be used in a file command.
Examples:
To macro substitute a variable name:
x = "hello"
hello = 10
? x hello
? &x 10
To macro substitute a file name:
x = "customer.dbf"
use &x &&Opens customer.dbf
ABS()
Function:
The ABS() function returns the absolute value of a numeric expression.
Syntax:
ABS(<nexpr>)
Return Value:
NUMERIC
Example:
? ABS(3) 3
? ABS(-3) 3
ASC()
Function:
The ASC() function returns the ASCII value of the first character in a
character expression.
Syntax:
ASC(<cexpr>)
57
Return Value:
NUMERIC
Remarks:
Returns the ASCII value of the first character in <cexpr> in the range 0
to 255. If the length of <cexpr> is 0 then ASC() returns 0.
Example:
? ASC('A') 65
? ASC("Hello") 72
See Also:
CHR()
AT()
Function:
The AT() function returns the starting position of a character string
within a second string.
Syntax:
AT(<cexpr1>,<cexpr2>)
Return Value:
NUMERIC
Remarks:
Returns the character offset in <cexpr1> where <cexpr2> is contained. If
<cexpr2> is not contained then 0 is returned.
Examples:
? AT("Hi there John","there") 4
WAIT TO x
responses = "123456"
IF AT(responses,x) =0
?"Invalid Choice"
ENDIF
See Also:
SUBSTR()
BOF()
Function:
The BOF() function indicates the beginning of the current database file.
Syntax:
BOF()
Return Value:
LOGICAL
Remarks:
58
Returns a logical True (.T.) when an attempt is made to move the record
pointer before the first logical record of the current database file.
Example:
USE customer
? BOF() .F.
SKIP -1
? BOF() .T.
See Also:
EOF()
CDOW()
Function:
The CDOW() function returns the character name of the day of the week
from a date expression.
Syntax:
CDOW(<dexpr>)
Return Value:
CHARACTER
Examples:
If the system date = 10/21/93
? CDOW(DATE()) Thursday
? CDOW(DATE()+1) Friday
See Also:
DAY(), DOW()
CDX()
Function:
The CDX() function returns the filename for the active index files in a
work area.
Syntax:
CDX(<nexpr1>[,<nexpr2>|<alias>])
Return Value:
CHARACTER
Remarks:
Returns the filename of an open .cdx file in a work area. <nexpr1> is
the .cdx file position in the index file list specified by the SET INDEX
TO <file list>, or USE INDEX <file list> commands. The optional second
parameter returns .cdx files for other work areas.
Example:
USE customer INDEX name.cdx, phone.cdx
? CDX(1) c:name.cdx
? CDX(2) c:phone.cdx
59
See Also:
NDX(), MDX()
CHR()
Function:
The CHR() function returns the character corresponding to an ASCII code
value.
Syntax:
CHR(<nexpr>)
Return Value:
CHARACTER
Remarks:
Returns a single character corresponding to the ASCII value of <nexpr>.
If <nexpr> is 0 then CHR() returns an empty string.
Example:
? CHR(65) A
? CHR(72)+CHR(105) Hi
See Also:
ASC(), INKEY()
CMONTH()
Function:
The CMONTH() function returns the character name of the month from a date
expression.
Syntax:
CMONTH(<dexpr>)
Return Value:
CHARACTER
Example:
Assume the date is 10/21/93
? CMONTH(DATE()) October
See Also:
MONTH()
COL()
Function:
The COL() function returns the current column position on the remote and
local screens.
Syntax:
COL()
60
Return Value:
NUMERIC
Remarks:
Returns current column position from 0 to 79.
Example:
? "Hello"
? col() 5
See Also:
@...SAY...GET, ROW()
CTOD()
Function:
The CTOD() function converts a character expression to a date value.
Syntax:
CTOD(<cexpr>) or
{<date>}
Return Value:
DATE
Remarks:
Returns a date value by converting <cexpr>. The format of <cexpr> is
mm/dd/yy with SET CENTURY OFF, or mm/dd/ccyy with SET CENTURY ON.
The {} structure allows for date literals. The syntax is {mm/dd/yy}.
Example:
STORE CTOD('02/28/93') to test
? test 02/28/93
? test +5 03/05/93
See Also:
DTOC(), SET CENTURY
DATE()
Function:
The DATE() function returns the current system date.
Syntax:
DATE()
Return Value:
DATE
Example:
Assume the system date is 10/21/93
? DATE() 10/21/93
See Also:
DAY(), MONTH(), SET CENTURY, YEAR()
61
DAY()
Function:
The DAY() function returns the day of the month from a date expression.
Syntax:
DAY(<dexpr>)
Return Value:
NUMERIC
Example:
If the system date is 10/21/93
? DAY(DATE()) 21
See Also:
DATE(), MONTH(), YEAR()
DBF()
Function:
The DBF() function returns the filename of the database in the current
work area.
Syntax:
DBF()
Return Value:
CHARACTER
Remarks:
Returns the full path used to specify the database in the current work
area.
Example:
USE customer
? dbf() c:customer.dbf
See Also:
CDX(), FIELD(), LUPDATE(), MDX(), NDX(), RECCOUNT(), RECSIZE()
DELETED()
Function:
The DELETED() function identifies records that are marked for deletion.
Syntax
DELETED()
Return Value:
LOGICAL
Remarks:
62
Returns True (.T.) if the current record is marked for deletion, if not,
False (.F.) is returned.
Example:
USE customer
? DELETED() .F.
DELETE
? DELETED() .T.
See Also:
DELETE, PACK, RECALL, SET DELETED ON
DISKSPACE()
Function:
The DISKSPACE() function returns the number of bytes available on the
default drive.
Syntax:
DISKSPACE()
Return Value:
NUMERIC
See Also:
GETENV(), OS(), VERSION()
DOW()
Function:
The DOW() function returns a number representing the day of the week.
Syntax
DOW(<dexpr>)
Return Value:
NUMERIC
Remarks:
Returns a number representing the day of the week. Sunday returns 1, and
Saturday returns 7
Example:
Assume the system date is 10/21/93
? DOW(DATE()) 5
See Also:
CDOW(), DAY()
DTOC()
Function:
The DTOC() function returns a character representation of the date
expression.
63
Syntax:
DTOC(<dexpr>)
Return Value:
CHARACTER
Remarks:
Returns a character representation of <dexpr> in the form mm/dd/yy if SET
CENTURY is OFF, or mm/dd/ccyy if SET CENTURY is ON.
Example:
Assume the system date is 10/21/93
? DTOC(DATE()) 10/21/93
See Also:
CTOD(), SET CENTURY
EOF()
Function:
The EOF() function indicates the end of the current database file.
Syntax:
EOF()
Return Value:
LOGICAL
Remarks:
Returns a logical true (.T.) when record pointer is positioned after the
last logical record of the current database file.
Example:
USE customer
GOTO BOTTOM
? EOF() .F.
SKIP 1
? EOF() .T.
See Also:
BOF(), FOUND()
64
ERROR()
Function:
The ERROR() function returns the number corresponding to the error that
caused an error condition.
Syntax:
ERROR()
Return Value:
NUMERIC
Remarks:
The ERROR() function is used for runtime error handling. In the
procedure set by the ON ERROR command the ERROR() function can be used to
attempt corrective action and then RETRY execution. The return values of
the ERROR() function are outlined in APPENDIX A.
Example:
The following program will recover from the error: File is already open.
ON ERROR DO recover
<commands>
USE customer
<commands>
RETURN
PROCEDURE recover
IF ERROR() = 3
CLOSE DATABASES
RETRY && attempt to re-use
ENDIF
RETURN
See Also:
MESSAGE(), ON ERROR(), RETRY
EXP()
Function:
The EXP() function returns the value of ex.
Syntax:
EXP(<nexpr>)
Return Value:
NUMERIC
Remarks:
Returns the value ex where x is <nexpr>.
Example:
? EXP(1.000) 2.718
See Also:
65
LOG()
FIELD()
Function:
The FIELD() function returns field names from the current database file.
Syntax:
FIELD(<nexpr>)
Return Value:
CHARACTER
Remarks:
Returns the field name corresponding to <nexpr> in the file structure of
the current database file. The returned field name is in uppercase.
Example:
USE customer
? FIELD(2) LASTNAME
See Also:
DBF()
FILE()
Function:
The FILE() function determines the existence of a file on the disk.
Syntax:
FILE(<cexpr>)
Return Value:
LOGICAL
Remarks:
Returns a logical True (.T.) if the file specified by <cexpr> exists. If
no drive is specified the default drive is used. FILE() will search the
current directory first and then any directories specified by the SET
PATH TO command.
Example:
If the default drive is C and customer.dbf is on D
? FILE(customer.dbf) .F.
? FILE(d:customer.dbf) .T.
See Also:
SET PATH
FLOCK()
Function:
The FLOCK() function attempts to lock the current database file and
returns the whether it was successful.
66
Syntax:
FLOCK()
Remarks:
LOCK() will return True (.T.) if dB Online was able to lock the current
database file. It will return False (.F.) otherwise. Any file that has
been locked by another user cannot be written to.
A record remains locked until RLOCK() is issued, the file is closed, or
the UNLOCK command is issued.
FLOCK() will re-attempt to lock the current database based on the value
of SET REPROCESS TO.
Example:
IF FLOCK()
PACK && must lock before PACKing
ELSE
? "Unable to lock file", dbf()
RETURN
ENDIF
See Also:
LOCK(), RLOCK(), SET EXCLUSIVE, SET REPROCESS, UNLOCK, USE
FOUND()
Function:
The FOUND() function returns the success of the previous FIND, SEEK,
LOCATE, or CONTINUE command.
Syntax:
FOUND()
Return Value:
LOGICAL
Remarks:
Returns a logical True (.T.) if the previous FIND, SEEK, LOCATE, or
CONTINUE command is successful. If files are linked with the SET
RELATION command dB Online does an implicit SEEK on the slave database
files. FOUND() will then return the status of the slave files. If the
record pointer is moved with any other commands the result of FOUND() is
.F.
See Also:
CONTINUE, EOF(), LOCATE(), SEEK, SET RELATIOIN
67
GETENV()
Function:
The GETENV() function returns the value of an environmental system
variable.
Syntax:
GETENV(<cexpr>)
Return Value:
CHARACTER
Remarks:
Returns the value of the DOS system variable specified by <cexpr> such as
PATH or COMSPEC. If the character expression is not found, dB Online
returns a null string.
Example:
? GETENV("COMSPEC") C:\COMMAND.COM
? GETENV("PATH") C:\DOS;C:\BIN
See Also:
DISKSPACE, OS(), VERSION()
IIF()
Function:
The IIF() function is a shortcut to the IF...ENDIF structure. It returns
one of two values based on a logical expression.
Syntax:
IIF(<lexpr>,<expr1>,<expr2>)
Return Value:
<expr1> or <expr2>
Remarks:
Returns the value of <expr1> if <lexpr> is Logical True (.T.), otherwise
it returns the value of <expr2>.
Example:
lastname = "Smith"
? IIF(sex = 'M',"Mr. ","Ms. ") + lastname
See Also:
IF...ENDIF, DO CASE
INKEY()
Function:
The INKEY() function returns a value representing the most recent key
pressed by either the remote or local terminals. It does not wait for a
keypress.
68
Syntax:
INKEY()
Return Value:
NUMERIC
Remarks:
Returns a value in the range of 0 to 255 corresponding to a value in the
IBM Extended Character. If there are several characters in the
type-ahead buffer the first character is returned and cleared from the
buffer.
INKEY() returns zero if no key is pressed and the control-key equivalent
of cursor and extended keys. The return values of INKEY are identified
in the following table:
Cursor Key Alternative Keys INKEY() return value
Right Ctrl-D 4
Left Ctrl-S 19
Up Ctrl-E 5
Down Ctrl-X 24
Ctrl-Right Ctrl-B 2
Ctrl-Left Ctrl-Z 26
Ins Ctrl-V 22
Delete Ctrl-G 7
Home Ctrl-A 1
End Ctrl-F 6
PgUp Ctrl-R 18
PgDn Ctrl-C 3
Ctrl-Home Ctrl-] 29
Ctrl-End Ctrl-W 23
Esc 27
Ctrl-PgUp Ctrl-_ 31
Ctrl-PgDn Ctrl-] 30
Example:
? "Press any key to continue"
DO WHILE INKEY() =0
@ 1,72 SAY TIME()
ENDDO
See Also:
CHR(), LASTKEY(), WAIT
INT()
Function:
The INT() function return the integer portion of a numeric argument
Syntax:
69
INT(<nexpr>)
Return Value:
NUMERIC
Remarks:
Returns the integer portion of <nexpr>. All digits to the right of the
decimal point are discarded.
Example:
? INT(23.55) 23
? INT(-5.5) -5
ISALPHA()
Function:
The ISALPHA function returns a logical True (.T.) if a character string
begins with an alpha character.
Syntax:
ISALPHA(<cexpr>)
Return Value:
LOGICAL
Remarks:
Returns a logical True (.T.) if the first character in <cexpr> is an
upper or lower case letter between a and z.
Example:
? ISALPHA("HELLO") .T.
? ISALPHA("123 Main St.") .F.
See Also:
ISLOWER(), ISUPPER()
ISCOLOR()
Function:
The ISCOLOR() function determines whether the user has selected color
operation.
Syntax:
ISCOLOR()
Return Value:
LOGICAL
Remarks:
This information is provided by a BBS drop file. See the ISCOLOR()
command in the BBS Information Functions section for further details.
ISCOLOR() a logical True (.T.) if the user has selected color operation.
Example:
To change default black and white colors if user is in color mode:
70
IF ISCOLOR()
SET COLOR TO W+/B,N/BG
ENDIF
See Also:
SET COLOR
ISLOWER()
Function:
The ISLOWER() function returns a logical True (.T.) if the character
expression begins with a lowercase letter.
Syntax:
ISLOWER(<cexpr>)
Return Value:
LOGICAL
Example:
? ISLOWER("Hello") .F.
? ISLOWER("hello") .T.
? ISLOWER("123 Main St.") .F.
See Also:
ISALPHA(), ISUPPER()
ISUPPER()
Function:
The ISUPPER() function returns a logical True (.T.) if the character
expression begins with a uppercase letter.
Syntax:
ISUPPER(<cexpr>)
Return Value:
LOGICAL
Example:
? ISUPPER("Hello") .T.
? ISUPPER("hello") .F.
? ISUPPER("123 Main St.") .F.
See Also:
ISALPHA(), ISLOWER()
LASTKEY()
Function:
The LASTKEY() function returns the value of the last key pressed to exit
a full screen READ command.
71
Syntax:
LASTKEY()
Return Value:
NUMERIC
Remarks:
The return values of LASTKEY correspond to the INKEY() values.
Example:
@ 2,2 SAY "NAME" GET NAME
<commands>
READ
IF LASTKEY() = 27
QUIT
ENDIF
See Also:
INKEY()
LEFT()
Function:
The LEFT() function returns a number of characters from the beginning of
the specified character expression.
Syntax:
LEFT(<cexpr>,<nexpr>)
Return Value:
CHARACTER
Remarks:
Returns the leftmost <nexpr> characters in <cexpr>. If <nexpr> is less
than or equal to zero, dB Online returns a null string. If <nexpr> is
greater than the length of <cexpr>, dB Online returns the entire string.
Example:
? LEFT([Hello There],5) Hello
See Also:
AT(), LTRIM(), RIGHT(), SUBSTR(), TRIM()
LEN()
Function:
The LEN() function returns the length of a character string.
Syntax:
LEN(<cexpr>)
Return Value:
NUMERIC
Remarks:
72
Returns the length of <cexpr>. If <cexpr> is a null string, dB Online
returns zero.
Example:
? LEN("Good Morning") 12
See Also:
TRIM()
LOCK()
Function:
The LOCK() function attempts to lock the current record and returns the
whether it was successful. LOCK() is identical to RLOCK(). Please refer
to RLOCK() in this section.
Syntax:
LOCK() | RLOCK()
See Also:
FLOCK(), RLOCK(), SET EXCLUSIVE, SET REPROCESS, UNLOCK, USE
LOG()
Function:
The LOG() function returns the natural logarithm of a numeric expression.
Syntax:
LOG(<nexpr>)
Return Value:
NUMERIC
Remarks:
Returns the natural logarithm of <nexpr>. <nexpr> must be greater than
zero.
Example:
? LOG(2.71828) 1.00000
See Also:
EXP()
LOWER()
Function:
The LOWER() function converts a character expression to lower case.
Syntax:
LOWER(<cexpr>)
Return Value:
CHARACTER:
73
Remarks:
Returns a string in which all uppercase characters in <cexpr> have been
converted to lowercase.
Example:
? LOWER("Hello") hello
See Also:
ISALPHA(), ISLOWER(), ISUPPER(), UPPER()
LTRIM()
Function:
The LTRIM() function removes leading blanks from a character expression.
Syntax:
LTRIM(<cexpr>)
Return Value:
<cexpr>
Example:
? STR(12.45) 12.45
? LTRIM(STR(12.45)) 12.45
See Also:
LEFT(), RIGHT(), RTRIM(), STR(), SUBSTR(), TRIM()
LUPDATE()
Function:
The LUPDATE() function returns the last date the current database file
was updated.
Syntax:
LUPDATE()
Return Value:
DATE
Example:
Assume the system date is 10/21/93
USE customer
?LUPDATE() 9/15/93
PACK
?LUPDATE() 10/21/93
See Also:
DBF()
MAX()
Function:
The MAX() function returns the largest of two numeric or date functions.
74
Syntax:
MAX(<nexpr1>|<dexpr1>,<nexpr2>|<dexpr2>)
Return Value:
NUMERIC|DATE
Remarks:
Returns the largest of the two values. Both <expr1> and <expr2> must be
either NUMERIC or DATE types.
Example:
? MAX(55,102) 102
See Also:
MIN()
MDX()
Function:
The MDX() function returns the filename for the active index files in a
work area.
Syntax:
MDX(<nexpr1>[,<nexpr2>|<alias>])
Return Value:
CHARACTER
Remarks:
Returns the filename of an open .mdx file in a work area. <nexpr1> is
the .mdx file position in the index file list specified by the SET INDEX
TO <file list>, or USE INDEX <file list> commands. The optional second
parameter returns .mdx files for other work areas.
Example:
USE customer INDEX name.mdx, phone.mdx
? MDX(1) c:name.mdx
? MDX(2) c:phone.mdx
See Also:
CDX(), DBF(), FIELD(), LUPDATE(), NDX(), SET INDEX, SET ORDER
MESSAGE()
Function:
The MESSAGE() function returns the message corresponding to an error
condition.
Syntax:
MESSAGE()
Return Value:
CHARACTER
75
Remarks:
Returns the character message during a runtime error handling procedure.
Example:
ON ERROR DO recover
<commands>
PROCEDURE recover
?"dB Online has encountered a run time error"
? MESSAGE()
? "Now exiting"
QUIT
RETURN
See Also:
ERROR()
MIN()
Function:
The MIN() function returns the smaller of two numeric or date functions.
Syntax:
MIN(<nexpr1>|<dexpr1>,<nexpr2>|<dexpr2>)
Return Value:
NUMERIC|DATE
Remarks:
Returns the smaller of the two values. Both <expr1> and <expr2> must be
either NUMERIC or DATE types.
Example:
? MIN(55,102) 55
See Also:
MAX()
MOD()
Function:
The MOD() function returns the remainder from a division of two numbers.
Syntax:
MOD(<nexpr1>,<nexpr2>)
Return Value:
NUMERIC
Remarks:
Returns the modulus, which is the remainder of <nexpr1> divided by
<nexpr2>
Example:
76
? MOD(10,8) 2
? MOD(0,60) 0
MONTH()
Function:
The MONTH() function returns a number representing the month from a date
expression.
Syntax:
MONTH(<dexpr>)
Return Value:
NUMERIC
Remarks:
Returns a value between 1 and 12 corresponding to January to December.
Example:
Assume the system date is 10/21/93
? MONTH(DATE()) 10
See Also:
CMONTH(), DAY(), YEAR()
NDX()
Function:
The NDX() function returns the filename for the active index files in a
work area.
Syntax:
NDX(<nexpr1>[,<nexpr2>|<alias>])
Return Value:
CHARACTER
Remarks:
Returns the filename of an open .ndx file in a work area. <nexpr1> is
the .ndx file position in the index file list specified by the SET INDEX
TO <file list>, or USE INDEX <file list> commands. The optional second
parameter returns .ndx files for other work areas.
Example:
USE customer INDEX name.ndx, phone.ndx
? NDX(1) c:name.ndx
? NDX(2) c:phone.ndx
See Also:
CDX(), DBF(), LUPDATE(), SET INDEX, SET ORDER
OS()
Function:
77
The OS() function returns the name of the operating system under which dB
Online is running.
Syntax:
OS()
Return Value:
CHARACTER
Remarks:
Returns a character value of the operating system. As dB Online only
operates in DOS environments, OS() returns the DOS version.
Example:
? OS() DOS 5.0
See Also:
DISKSPACE(), GETENV(), VERSION()
READKEY()
Function:
The READKEY() function returns a value representing the key pressed to
exit a full screen read statement. READKEY() also indicates whether any
data was changed.
Syntax:
READKEY()
Return Value:
NUMERIC
Remarks:
The READKEY() return values are identified in the table below. If none
of the data had been changed, the return value is between zero and 15.
If any of the data had been changed the return value increases by 256.
Key pressed READKEY() READKEY() Meaning
No changes Changes
Ctrl-S
Left , 0 256 Backward one
, Ctrl-H
BS character
Right , Ctrl-D 1 257 Forward one
character
Up , Ctrl-E 4 260 Backward one
field
Down , Ctrl-X 5 261 Forward one
field
PgUp , Ctrl-R 6 262 Backward one
screen
PgDn , Ctrl-C 7 263 Forward one
screen
Esc , Ctrl-Q 12 --- Terminate
without save
78
Ctrl-End 13 270 Terminate with
Ctrl-W save
Enter , Tab 15 271 Completed last
field
Example:
To determine if the contents of a memory variable were altered and to
REPLACE a field if changes were made.
@ 2,2 SAY "NAME" GET mname
READ
IF READKEY() >=256 && if data changed
REPLACE name WITH mname
ENDIF
See Also:
INKEY(), READ
RECCOUNT()
Function:
The RECCOUNT() function returns the number of records in the currently
selected database.
Syntax:
RECCOUNT()
Return Value:
NUMERIC
Example:
USE clients.dbf
? RECCOUNT() 49
See Also:
DBF(), DISKSPACE(), RECNO(), RECSIZE()
RECNO()
Function:
The RECNO() function returns the current record number of the selected
database.
Syntax:
RECNO()
Return Value:
NUMERIC
Example:
USE clients.dbf
? RECNO() 1
79
SKIP
? RECNO() 2
GO BOTTOM
? RECNO() 49
See Also:
GOTO, RECCOUNT(), SKIP
RECSIZE()
Function:
The RECSIZE() functions returns the size of a record in the currently
selected database file.
Syntax:
RECSIZE()
Return Value:
NUMERIC
Example:
USE customer.dbf
? RECSIZE() 43
See Also:
DBF(), DISKSPACE(), LUPDATE(), RECCOUNT()
REPLICATE()
Function:
The REPLICATE() function repeats a character expression a specified
number of times.
Syntax:
REPLICATE(<cexpr>,<nexpr>)
Return Value:
CHARACTER
Remarks:
Returns <cexpr> repeated <nexpr> times. The resulting character
expression must not exceed 254 characters.
Example:
REPLICATE can be used to create bar graphs
percent1 = 30
percent2 = 60
? percent1, REPLICATE('*',percent1/10)
30 ***
? percent2, REPILCATE('*',percent2/10)
60 ******
See Also:
SPACE()
80
RIGHT()
Function:
The RIGHT() function returns a specified number of characters from the
end of a character expression.
Syntax:
RIGHT(<cexpr>,<nexpr>)
Return Value:
CHARACTER
Remarks
Return the last <nexpr> characters of <cexpr>. If <nexpr> is less than
or equal to zero, then a null string is returned. If <nexpr> is greater
than the length of <cexpr> then the entire string is returned.
Example:
? RIGHT('Hello Bob',3) Bob
See Also:
LEFT(), LTRIM(), SUBSTR(), TRIM()
RLOCK()
Function:
The RLOCK() function attempts to lock the current record and returns the
whether it was successful.
Syntax:
RLOCK() | LOCK()
Remarks:
RLOCK() will return True (.T.) if dB Online was able to lock the current
record. It will return False (.F.) otherwise. Any record that has been
locked by another user cannot be written to.
A record remains locked until the the record pointer is moved, the file
is closed, or the UNLOCK command is issued.
RLOCK() will re-attempt to lock the current record based on the value of
SET REPROCESS TO.
Example:
IF RLOCK()
DO editproc && edit the record
ELSE
CLEAR
? "Unable to lock record"
RETURN
ENDIF
See Also:
FLOCK(), LOCK(), SET EXCLUSIVE, SET REPROCESS, UNLOCK, USE
81
ROUND()
Function:
The ROUND() function rounds off numbers to a specified number of decimal
places.
Syntax:
ROUND(<nexpr1>,<nexpr2>)
Return value:
NUMERIC
Remarks:
Returns <nexpr1> rounded off to <nexpr2> decimal places. If <nexpr2> is
negative, Round() returns a rounded whole number.
Example:
? ROUND(123.4567,2) 123.46
? ROUND(123.4567,0) 123
? ROUND(123.4567,-1) 120
See Also:
INT()
ROW()
Function:
The ROW() function returns the row number of the current cursor position
on the local and remote screens.
Syntax:
ROW()
Return value:
NUMERIC
Remarks:
Returns the current row number between 0 and 24.
Example:
CLEAR
? ROW() 1
? ROW() 2
See Also:
@...SAY...GET, ROW()
RTRIM()
Function:
The RTRIM() function removes trailing blanks from a character expression.
Syntax:
82
RTRIM(<cexpr>)
Return Value:
<cexpr>
Remarks:
The RTRIM() function is identical to the TRIM() function.
Example:
title = "Mr. "
name = "Jones"
? title + name Mr. Jones
? RTRIM(title)+' '+name Mr. Jones
See Also:
LEFT(), LTRIM(), RIGHT(), TRIM()
SPACE()
Function:
The SPACE() function generates a character string containing a specified
number of spaces.
Syntax:
SPACE(<nexpr>)
Return value:
CHARACTER
Remarks:
The range of <nexpr> is from 0 to 254
Example:
? '*' + SPACE(10) + '*' * *
See Also:
REPLICATE()
SQRT()
Function:
The SQRT() function returns the square root of a specified positive
numeric argument.
Syntax:
SQRT(<nexpr>)
Return value:
NUMERIC
Example:
? SQRT(4) 2
? SQRT(2) 1.4
? SQRT(2.0000) 1.414
83
STR()
Function:
The STR() function converts a number into a character string
Syntax:
STR(<nexpr1>[,<nexpr2>][,<nexpr3>])
Return value:
CHARACTER
Remarks:
Returns a character representation of <nexpr1>. The total length of the
string is specified by <nexpr2>. The number of decimals in the string is
specified by <nexpr3>. If <nexpr2> is not specified the string length is
10. If <nexpr3> is not specified the number is truncated to an integer.
The length includes the decimal point, minus sign and any numbers. If
the number specified is too large to fit into the length, dB Online
returns asterisks in the string.
Example:
? STR(10.54,5,2) 10.54
? STR(10.54) 10
? STR(1459,3,0) ***
See Also:
SUBSTR(), VAL()
STUFF()
Function:
The STUFF() function replaces a portion of a character string with
another character string.
Syntax:
STUFF(<cexpr1>,<nexpr1>,<nexpr2>,<cexpr2>)
Return value:
CHARACTER
Remarks:
Character expression <cexpr1> is the string to be altered. Character
expression <cexpr2> is to be inserted into <cexpr1>.
The insertion takes place at the position specified by <nexpr1>. At this
position <nexpr2> characters are removed from <cexpr1> and then <cexpr2>
is inserted.
Example:
? STUFF('abc',2,1,'xyz') axyzc
? STUFF('abc',2,1,'') ac
? STUFF('abc',2,0,'xyz') axyzbc
See Also:
84
LEFT(), RIGHT(), SUBSTR()
SUBSTR()
Function:
The SUBSTR() function extracts a specified number of characters from a
character string.
Syntax:
SUBSTR(<cexpr>,<nexpr1>[,<nexpr2>])
Return value:
CHARACTER:
Remarks:
Returns the next <nexpr2> characters of <cexpr> beginning at the
<nexpr1> position. If <nexpr2> is not specified, dB Online returns the
remainder of <cexpr>
Example:
? SUBSTR("Press any key",7,3) any
See Also:
AT(), LEFT(), RIGHT(), STR(), STUFF()
TAG()
Function:
The TAG() function returns the TAG names in the currently selected
database.
Syntax:
TAG(<nexpr>[,<nexpr1>|<alias>])
Return value:
CHARACTER:
Remarks:
Returns the name of an index file (.ndx, .ntx) or a tag name (.cdx, .mdx)
of the currently selected database. In dBASE III+ and Clipper file
formats, <nexpr1> identifies the index file in the position as specified
in the SET INDEX TO, or USE INDEX command. In dBASE IV and FoxPro file
formats, <nexpr1> identifies the tag number of all opened multiple index
files.
The second parameter is used to identify tags in other work areas.
Example:
To identify the second tag of cust.mdx
USE customer.dbf INDEX cust.mdx
? TAG(2) PHONE
See Also:
CDX(), DBF(), MDX(), NDX(), SET INDEX, SET ORDER, USE
85
TIME()
Function:
The TIME() function return the current system time.
Syntax:
TIME()
Return Value:
CHARACTER
Remarks:
Returns the current system time in the format hh:mm:ss
Example:
? TIME() 12:36:55
See Also:
DATE()
TRANSFORM()
Function:
The TRANSFORM() function allows PICTURE formatting of data without using
the @...SAY command.
Syntax:
TRANSORM(<expr>,<cexpr>)
Return value:
CHARACTER
Remarks:
Returns the data in <expr> in the format specified by the PICTURE format
<cexpr>. <expr> can be any of the four data types: NUMERIC, CHARACTER,
LOGICAL, DATE. For information about PICTURE formats, refer to the @
command.
Example:
? TRANSFORM('john','!XXX') John
? TRANSFORM(4123.5,'999,999.99') 4,123.50
See Also:
@...SAY...GET
TRIM()
Function:
The TRIM() function is identical to the RTRIM() function. Please refer
to RTRIM() in this section.
Syntax:
TRIM(<cexpr>)
86
Return Value:
CHARACTER
See Also:
LTRIM(), RTRIM()
UPPER()
Function:
The UPPER() function converts a character expression to upper case.
Syntax:
UPPER(<cexpr>)
Return Value:
CHARACTER:
Remarks:
Returns a string in which all lowercase characters in <cexpr> have been
converted to uppercase.
Example:
? UPPER("Hello") HELLO
See Also:
LOWER()
VAL()
Function:
The VAL() function converts a character representation of a number into a
numeric expression.
Syntax:
VAL(<cexpr>)
Return Value:
NUMERIC
Remarks:
Returns the value of <cexpr>. Any leading blanks are ignored in <cexpr>.
Once numeric digits are found, VAL() proceeds left to right until a non
numeric character is encountered. If <cexpr> is non-numeric, VAL()
returns zero. The decimal portion of the returned number is determined
by SET DECIMALS.
Example:
? VAL(" 555") 555.00
? VAL("Hello") 0.00
See Also:
SET DECIMALS, STR()
VERSION()
87
Function:
The VERSION() function returns the version number of dB Online in use.
Syntax:
VERSION()
Return Value:
CHARACTER
Example:
?VERSION() dB Online 1.10
See Also:
DISKSPACE(), GETENV(), OS()
YEAR()
Function:
The YEAR() function returns a number representing the year from a date
expression.
Syntax:
YEAR(<dexpr>)
Return Value:
NUMERIC
Example:
Assume the system date is 10/21/93
? YEAR(DATE()) 1993
See Also:
DATE(), DAY(), MONTH()
88
BBS Information Functions
The BBS Information Functions provide a way to include information from the
BBS drop files into a dB Online application. Included with the description of
each function is a Valid With clause. This determines which BBS drop files
provide the information for the given function. If this BBS drop file is not
included in the command line of dB Online a null value will be returned by the
BBS Information Function.
BAUD()
Function:
The BAUD() function returns the baud the user connected at.
Syntax:
BAUD()
Return Value:
NUMERIC
Remarks:
If the user is connected locally, then BAUD() returns zero.
Valid With:
pcboard.sys, exitinfo.bbs, door.sys, dorinfox.def, chain.txt,
callinfo.bbs
See Also:
COMMPORT(), DTE()
BBSNAME()
Function:
The BBSNAME() function returns the name of the calling BBS.
Syntax:
BBSNAME()
Return Value:
CHARACTER
Valid With:
chain.txt, dorinfox.def
CITY()
Function:
The CITY() function returns the user's city and state or province.
Syntax:
CITY()
Return Value:
CHARACTER
89
Valid With:
exitinfo.bbs, door.sys, dorinfo1.def, users.sys, callinfo.bbs
COMMPORT()
Function:
The COMMPORT() function returns a numeric value corresponding to the comm
port connection.
Syntax:
COMMPORT()
Return Value:
NUMERIC
Remarks:
If the user is connected locally, then COMMPORT() will return zero.
Valid With:
pcboard.sys, door.sys, dorinfo1.def, chain.txt, callinfo.bbs
See Also:
BAUD(), DTE(), ISLOCAL()
CONFERENCE()
Function:
The CONFERENCE() function returns the number of the conference or area
the user was in before calling the dB Online door.
Syntax:
CONFERENCE()
Return Value:
NUMERIC
Valid With:
pcboard.sys, door.sys
See Also:
NODE()
DATABITS()
Function:
The DATABITS() function returns the number of databits of the current
communications port.
Syntax:
DATABITS()
Return Value:
NUMERIC
Valid With:
90
dorinfox.def, callinfo.bbs
Remarks:
If a valid BBS drop file does not exist, the DATABITS() function returns
a default value of 8.
See Also:
PARITY(), STOPBITS()
DATAPHONE()
Function:
The DATAPHONE() function returns the user's data phone number.
Syntax:
DATAPHONE()
Return Value:
NUMERIC
Valid With:
exitinfo.bbs, door.sys, users.sys, callinfo.bbs
See Also:
VOICEPHONE()
DTE()
Function:
The DTE() function returns the DTE baud of the user.
Syntax:
DTE()
Return Value:
NUMERIC
Valid With:
pcboard.sys, door.sys, callinfo.bbs
See Also:
BAUD(), COMMPORT()
ERRORCOR()
Function:
The ERRORCOR() function identifies if an error correcting connection has
been established.
Syntax:
ERRORCOR()
Return Value:
LOGICAL
Valid With:
91
pcboard.sys, exitinfo.bbs, door.sys, callinfo.bbs
FIRSTNAME()
Function:
The FIRSTNAME() function returns the user's first name with appropriate
capitalization.
Syntax:
FIRSTNAME()
Return Value:
CHARACTER
Valid With:
pcboard.sys, dorinfo1.def
See Also:
USERNAME()
ISANSI()
Function:
The ISANSI() function returns whether the user is in ANSI compatible
mode.
Syntax:
ISANSI()
Return Value:
LOGICAL
Valid With:
pcboard.sys, door.sys, dorinfo1.def, chain.txt
See Also:
ISCOLOR(), ISRIP()
ISCOLOR()
Function:
The ISCOLOR() function returns whether the user is in color mode.
Syntax:
ISCOLOR()
Return Value:
LOGICAL
Valid With:
pcboard.sys, door.sys, callinfo.bbs
See Also:
ISANSI(), ISRIP(), SET COLOR,
92
ISLOCAL()
Function:
The ISLOCAL() function returns whether the user is in local mode.
Syntax:
ISLOCAL()
Return Value:
LOGICAL
Valid With:
all
ISRIP()
Function:
The ISRIP() function returns whether the user is in RIP mode.
Syntax:
ISRIP()
Return Value:
LOGICAL
Valid With:
pcboard.sys, door.sys
See Also:
ISANSI(), ISCOLOR()
LANGUAGE()
Function:
The LANGUAGE() function returns the user's language filename extension.
Syntax:
LANGUAGE()
Return Value:
CHARACTER
Valid With:
pcboard.sys
Remarks:
The LANGUAGE() function will return a null string if the language
extension is English. Otherwise it will return a 4 character string
which could correspond to the extension on text files to be displayed:
i.e.. If the French language is chosen then ".FRE" is returned.
93
NODE()
Function:
The NODE() function return the node number the user is on.
Syntax:
NODE()
Return Value:
NUMERIC
Valid With:
pcboard.sys, door.sys, callinfo.bbs
Remarks:
The NODE() function is useful for creating temporary file names for each
BBS node.
See Also:
CONFERENCE()
PAGELEN()
Function:
The PAGELEN() function returns the user's page length setting.
Syntax:
PAGELEN()
Return Value:
NUMERIC
Valid With:
exitinfo.bbs, door.sys, user.sys, chain.txt, callinfo.bbs
See Also:
@..SAY...GET
PARITY()
Function:
The PARITY() function identifies the parity setting of the current comm
port.
Syntax:
PARITY()
Return Value:
CHARACTER
Valid With:
door.sys
Remarks:
PARITY() will return 'EVEN' for even parity and 'NONE' for no parity.
94
PASSWORD()
Function:
The PASSWORD() function returns the user's password.
Syntax:
PASSWORD()
Return Value:
CHARACTER
Valid With:
pcboard.sys, door.sys, users.sys, callinfo.bbs
See Also:
SECURITY()
PROTOCOL()
Function:
The PROTOCOL() function returns the user's selected protocol.
Syntax:
PROTOCOL()
Return Value:
CHARACTER
Valid With:
door.sys, users.sys, callinfo.bbs
Remarks:
The return value will be a single character. Possible values include:
Return Value Protocol
A ASCII
X Xmodem
C Xmodem-CRC
1 Xmodem-1K
Y Ymodem (batch)
G Ymodem-G
Z Zmodem
K Kermit
SECURITY()
Function:
The SECURITY() function returns the user's security level.
Syntax:
SECURITY()
95
Return Value:
NUMERIC
Valid With:
exitinfo.bbs, door.sys, dorinfox.def, users.sys, chain.txt, callinfo.bbs
See Also:
PASSWORD()
STOPBITS()
Function:
The STOPBITS() function identifies the number of stopbits of the current
comm port settings.
Syntax:
STOPBITS()
Return Value:
NUMERIC
Valid With:
dorinfox.def
Remarks:
If a valid BBS drop file is not included then STOPBITS returns a default
value of one.
See Also:
DATABITS(), PARITY()
TIMELEFT()
Function:
The TIMELEFT() function returns the user's time left in minutes.
Syntax:
TIMELEFT()
Return Value:
NUMERIC
Valid With:
pcboard.sys, door.sys, dorinfox.def, chain.txt, callinfo.bbs
Remarks:
A timeout occurs when dB Online has been running for the number of
minutes initially passed by the BBS drop files. If no BBS drop files are
specified (i.e. Local or Stand Alone operation), the initial value for
TIMELEFT() is 999 minutes.
See Also:
TIME()
96
USERNAME()
Function:
The USERNAME() function returns the user's full name.
Syntax:
USERNAME()
Return Value:
CHARACTER
Valid With:
pcboard.sys, exitinfo.bbs, door.sys, dorinfo1.def, users.sys, chain.txt,
callinfo.bbs
Remarks:
The USERNAME() function returns the name as the BBS stores it. This is
usually in full capitals.
See Also:
FIRSTNAME()
VOICEPHONE()
Function:
The VOICEPHONE() function returns the user's voice phone number.
Syntax:
VOICEPHONE()
Return Value:
CHARACTER
Valid With:
exitinfo.bbs, door.sys, users.sys, callinfo.bbs
See Also:
DATAPHONE()
97
Appendices
Appendix 1: Errorlevels
PROGRAM EXECUTION ERRORS
The following values are returned to the DOS errorlevel upon termination of dB
Online. These errors below 100 are returned when execution is halted during
.PRG execution. The error message will appear on the dB Online exit screen.
0..Normal Termination
The .PRG application completed execution and terminated correctly.
1..Runtime Error
A runtime error occurred in the .PRG application. Before program
termination the source .PRG filename and line number of the error is
indicated to assist the debugging process. Runtime errors can be trapped
with the ON ERROR command.
10..Auto Timeout
The user time provided to dB Online from the BBS info functions has
expired during program execution. dB Online terminates and returns
control to the calling application.
11..Lost Carrier
The carrier was lost during program execution. dB Online terminates and
returns control to the calling application.
12..Terminated Escape
The user pressed the <Esc> key when SET ESCAPE was set to ON.
causes dB Online to terminate and return control to the calling
application.
13..Unexpected Runtime
An internal error has occurred within dB Online. Your .DBX file may be
corrupt. Re-compile the source .PRG file and then execute dB Online. If
this does not solve the problem please contact Merlin Systems Inc.
14..Run Stack Overflow
An attempt was made to nest procedure calls too deep. dB Online is able
to nest procedure call up to 20 levels deep. If parameters are passed
with procedure calls then this limit is reduced. If this error persists
please contact Merlin Systems Inc.
15..Run Stack Underflow
98
An internal error has occurred within dB Online. Your .DBX file may be
corrupt. Re-compile the source .PRG file and then execute dB Online. If
this does not solve the problem please contact Merlin Systems Inc.
16..Evaluation Stack Overflow
An attempt was made to evaluate an expression too complex for the dB
Online evaluator. This can be fixed by splitting the complex expression
onto two command lines. Please contact Merlin System Inc. if you receive
this error.
17..Evaluation Stack Underflow
An internal error has occurred within dB Online. Your .DBX file may be
corrupt. Re-compile the source .PRG file and then execute dB Online. If
this does not solve the problem please contact Merlin Systems Inc.
START UP ERRORS
The following values are returned to the DOS errorlevel upon termination
of dB Online. These errors above 100 are returned when execution is
halted during setup prior to .DBX execution. This error message will
appear on the DOS screen upon exit.
100..Syntax Explanation
dB Online was executed without any parameters. This displays the command
line syntax information.
101..Cannot Open DBX
dB Online could not open the source .DBX file. Ensure that your source
.PRG file is compiled and the resultant .DBX file's path is fully
specified in the command line.
102..Not a Valid DBX
The .DBX file is not a valid dB Online file. Ensure that your source
.PRG file is compiled with the current version of COMPILE.EXE
103..Cannot Find USERS.SYS File
dB Online cannot find the USERS.SYS file specified on the command line.
104..Cannot Find PCBOARD.SYS File
105..Cannot Find EXITINFO.BBS File
106..Cannot Find DORINFO1.DEV File
107..Cannot Find DOOR.SYS File
108..Cannot Find CALLINFO.BBS File
109..Invalid Command Line Argument
An invalid argument was included in the command line.
99
110..Corrupted DBONLINE.KEY File
The DBONLINE.KEY file has been corrupted. Copy your backup DBONLINE.KEY
file to your DBONLINE directory. If this does not solve the problem
please contact Merlin Systems.
111..Expired Beta KEY File
The DBONLINE.KEY file that was issued to the beta testers has expired.
112..Unable to Open COMM Port
dB Online was unable to open the comm port that was specified in one of
the BBS information files or in the PORT: command line parameter.
113..Port Information Not Specified
There was no port information specified in any of the BBS information
files and the PORT: command line parameter was not found. This error
only occurs with the -SA option for Stand Alone operation.
114..Stand Alone Interrupt
The sysop on the host pressed <Esc> on the call waiting screen of the
Stand Alone option. This causes dB Online to terminate and return
control back to the calling program.
115..Stand Alone Unavailable
An attempt was made to execute dB Online with the Stand Alone option
without having the PRO version of dB Online. Please contact Merlin
Systems if you wish to upgrade.
100
Appendix 2: Compiler Messages
Error Messages
The following is a list of error messages displayed by the compiler
Alias name required.
Character literal required.
Exponent too large.
Field identifier required.
Illegal number of arguments.
Misplaced parameters list.
Misplaced set procedure command.
Missing endcase.
Missing enddo.
Missing endif.
Not a function.
On Error only supports procedure calls.
Picture clause expected.
Procedure name expected.
Procedure redeclaration.
Right brace expected.
Source line too long.
Syntax Error.
Too Many errors.
Unable to open source file.
Unexpected command.
Unexpected end of line.
Unmatched case statement.
Unmatched else statement.
Unmatched endcase statement.
Unmatched enddo statement.
Unmatched endif statement.
Unmatched number of parameters.
Unmatched otherwise statement.
Unmatched variable list.
Unrecognized command verb.
Variable identifier expected.
Work area out of range.
Warning Messages
The following is a list of warning messages displayed by the compiler. These
indicate xBase commands that are not valid in the dB Online environment and
will not affect program execution.
CLOSE PROCEDURE ignored
SET CATALOG not supported
SET DATE not supported
SET HEADING not supported
SET HELP not supported
SET HISTORY not supported
SET ODOMETER not supported
SET PRINTER not implemented
SET PROCEDURE TO ignored
SET SAFETY not supported
101
SET SCOREBOARD not supported
SET STATUS not supported
SET TALK not supported
TO PRINT not implemented
102
Appendix 3: Runtime Errors
Below is a list of runtime error message for dB Online. The number in the
parenthesis is the value returned by the ERROR() function in error handling
routines.
(24) ALIAS name already in use:
(13) ALIAS not found:
(38) Beginning of file encountered:
(17) Cannot select requested database:
(111) Cannot write to read-only file:
(42) CONTINUE without LOCATE:
(44) Cyclic relation:
(9) Data type mismatch:
(26) Database is not indexed:
(41) Memo file cannot be opened:
(4) End of file encountered:
(77) Execution error on +: Concatenated string too large:
(76) Execution error on -: Concatenated string too large:
(78) Execution error on ^ or **: Negative base) fractional exponent:
(57) Execution error on CHR(): Out of range:
(58) Execution error on LOG(): Zero or negative:
(87) Execution error on NDX(): Invalid index number:
(88) Execution error on REPLICATE(): String too large:
(60) Execution error on SPACE(): Negative:
(59) Execution error on SPACE(): Too large:
(61) Execution error on SQRT(): Negative:
(79) Execution error on STORE: String too large:
(63) Execution error on STR(): Out of range:
(102) Execution error on STUFF(): String too large:
(62) Execution error on SUBSTR(): Start point out of range:
(7) File already exists:
(1) File does not exist:
(3) File is already open:
(108) File is in use by another:
(46) Illegal value:
(19) Index file does not match database:
(106) Invalid index number:
(107) Invalid operator:
(123) Invalid printer port:
(55) Memory Variable file is invalid:
(52) No database in use:
(45) Not a character expression:
(15) Not a dBASE database:
(37) Not a Logical expression:
(27) Not a numeric expression:
(39) Numeric overflow (data was lost):
(90) Operation with Logical field invalid:
(34) Operation with Memo field invalid:
(30) Position is off the screen:
(126) Printer is either not connected or turned off:
(109) Record is in use by another:
(20) Record is not in index:
(5) Record is out of range:
(142) Relation record is in use by others:
(209) TAG not found:
(28) Too many indices:
(92) Unable to load COMMAND.COM:
103
( 0) Unable to open file:
(12) Variable not found:
(-1) Shareware version: 50 record max exceeded:
(-2) Multiple work areas not available:
(-3) Shareware version: Cannot RUN dos commands:
104
Appendix 4: Full Screen Entry Keys
The following keys are used in full-screen operations. Keys apply to both
data entry screens and the memo editor.
Key Alternative Function
Up Ctrl-E Moves the cursor up one line or
field
Down Ctrl-X Moves the cursor down one line
or field
Left Ctrl-S Moves the cursor one space to
the left.
Right Ctrl-D Moves the cursor one space to
the right.
Ctrl-Left Ctrl-F Moves the cursor a word left in
the memo editor
Ctrl-Right Ctrl-A Moves the cursor a word right in
the memo editor
BS Ctrl-H Erases the character to the left
of the cursor
Delete Ctrl-G Erases the character at the
current cursor position.
End Ctrl-F Moves the cursor to the end of
the line or field
Ctrl-End Ctrl-W Exits and saves changes to memo
or entry screens.
Enter Ctrl-M Moves the cursor to the next
field or line.
Escape Ctrl-Q Exits without saving changes.
Home Ctrl-A Moves the cursor to the start of
the line or field
Insert Ctrl-V Toggles insert mode.
PgUp Ctrl-R Moves the cursor up one page.
PgDn Ctrl-C Moves the cursor down one page.
Ctrl-PgDn Ctrl-O Enter full screen memo editor.
Ctrl-PgUp Ctrl-W Exit memo screen editor.
Tab Completes field entry and moves
to next field.
Ctrl-Y Erases line in memo editor.
105
Index
CTOD(), 61 GO|GOTO, 28
?
?|??, 18 D I
@...CLEAR, 19 DATABITS(), 90 IF, 29
@...SAY...GET, 19 DATAPHONE(), 91 IIF(), 68
@...TO, 21 DATE(), 61 IN, 55
&& (NOTE), 30 DAY(), 62 Index file, 5
& (Macro), 57 dBASE III+, 2, 9, INKEY(), 68
* (NOTE), 30 48, 49, 85 INPUT, 29
dBASE IV, 2, 9, 48, INT(), 69
A 49, 55, 85 ISALPHA(), 70
DBF(), 62 ISANSI(), 92
ABS(), 57 DBX, 6, 7, 10 ISCOLOR(), 70
ACCEPT, 22 DELETE, 25 ISLOCAL(), 93
ALIAS, 55 DELETED(), 62 ISLOWER(), 71
Aliases, 15, 40 DigiBoard, 13 ISRIP(), 93
APPEND BLANK, 22 DISKSPACE(), 63 ISUPPER(), 71
Arnet, 13 DISPLAY, 26
ASC(), 57 DO, 26 L
AT(), 58 DO CASE, 27
AVERAGE, 22 DO WHILE, 27 LANGUAGE(), 93
DOW(), 63 LASTKEY(), 71
B DTE(), 91 LEFT(), 72
BAUD(), 89 DTOC(), 63 LEN(), 72
BBS Doorway Mode, 1, Licence Levels, 1
9 E LIST, 29
BBS drop files, 10 Local/LAN Mode, 1,
BBSNAME(), 89 ELSE, 29 10
BIOS, 12 ENDCASE, 27 LOCATE, 30
BOF(), 58 ENDDO, 27 LOCK(), 73
ENDIF, 29 LOG(), 73
C ENDTEXT, 53 LOOP, 27
CANCEL, 23 EOF(), 64 LOWER(), 73
CASE, 27 ERASE, 28 LTRIM(), 74
CDOW(), 59 ERROR(), 65, 103 LUPDATE(), 74
CDX, 5, 9, 48 ERRORCOR(), 91
CDX(), 59 EXIT, 27 M
CHR(), 60 EXP(), 65 MAX(), 74
CITY(), 89 MDX, 5, 9, 48
CLEAR, 23 F MDX(), 75
CLEAR ALL, 23 FIELD(), 66 MESSAGE(), 75
CLEAR GETS, 24 Fields, 4, 15 MIN(), 76
CLEAR TYPEAHEAD, 24 FILE(), 66 MOD(), 76
Clipper, 2, 9, 48, FIRSTNAME(), 92 MONTH(), 77
49, 85 FLOCK(), 66
CLOSE, 24 FOSSIL, 12 N
CMONTH(), 60 FOUND(), 67 NDX, 5, 9, 48
COL(), 60 FoxPro, 2, 9, 48, NDX(), 77
COM, 12 49, 55, 85 NODE(), 94
COMMPORT(), 90 NOTE, 30
CONFERENCE(), 90 G NTX, 5, 9, 48
CONTINUE, 24 GET, 19
COUNT, 25 GETENV(), 68 O
Index
ON ERROR, 31 SECURITY(), 95 UPPER(), 87
ON ESCAPE, 31 SEEK, 39 USE, 55
OS(), 77 SELECT, 39 USERNAME(), 97
OTHERWISE, 27 SET ALTERNATE, 40
SET BELL, 41 V
P SET CENTURY, 41 VAL(), 87
PACK, 32 SET COLOR, 41 Variables, 15
PAGELEN(), 94 SET CONFIRM, 43 VERSION(), 87
PARAMETERS, 32, 33 SET CONSOLE, 43 VOICEPHONE(), 97
PARITY(), 94 SET DECIMALS, 43
PASSWORD(), 95 SET DEFAULT, 44 W
PICTURE, 20 SET DELETED, 44
PORT, 10, 12 SET DELIMITERS, 45 WAIT, 55
PRG, 6 SET ESCAPE, 45
PRIVATE, 33 SET EXACT, 46 Y
Pro Version, 1, 38, SET EXCLUSIVE, 46 YEAR(), 88
39, 51 SET FILTER, 46
PROCEDURE, 33 SET FIXED, 47
PROTOCOL(), 95 SET INDEX, 48
PUBLIC, 34 SET INTENSITY, 48
SET LOCK, 49
Q SET MEMOWIDTH, 49
SET ORDER, 49
QUIT, 34 SET PATH, 50
SET PROCEDURE, 50
R SET PROCEDURE TO, 6
RANGE, 19 SET RELATION, 51
READ, 34 SET REPROCESS, 51
READKEY(), 78 Shareware Version, 1
RECALL, 35 SKIP, 52
RECCOUNT(), 79 SPACE(), 83
RECNO(), 79 SQRT(), 83
Record, 4 Stand Alone Mode, 1,
RECSIZE(), 80 10
Registered Version, StarGate, 13
1, 2, 38 STOPBITS(), 96
REINDEX, 35 STORE, 52
RENAME, 35 STR(), 84
REPLACE, 36 STUFF(), 84
REPLICATE(), 80 SUBSTR(), 85
RESTORE, 36 SUM, 53
RETRY, 37
RETURN, 37 T
RIGHT(), 81 Tag, 4
RLOCK(), 81 TAG(), 85
ROUND(), 82 TEXT, 53
ROW(), 82 TIME(), 86
RTRIM(), 82 TIMELEFT(), 96
RUN, 1, 38 TRANSFORM(), 86
TRIM(), 86
S
SAVE, 38 U
SAY, 19
UNLOCK, 54